/*
 * Веб-кабинет «Монтаж ПУ».
 * Компоновка — по образцу AXENTA CMS (светлый интерфейс, боковое меню, плотные таблицы),
 * цвета — как в мобильном приложении и на сайте ГЛОНАСС-СЕРВИС.
 */

@font-face {
  font-family: "Manrope";
  src: url("fonts/Manrope-var.784702c22f34.woff") format("woff");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  /* Фирменные цвета (как в Theme.kt приложения) */
  --navy: #1D3A8F;
  --blue: #005BAA;
  --blue-dark: #004A8C;
  --cyan: #14B1E7;
  --teal: #0C85AA;
  --orange: #EA8917;
  --green: #2E8B3E;
  --red: #C62828;

  --ink: #333333;
  --ink-2: #4E515B;
  --muted: #868A94;
  --line: #E8E9EC;
  --line-2: #D5D8DD;
  --side-bg: #F6F7F9;
  --hover: #F4F7FB;
  --sel: #E3EEF8;
  --row-sel: #EEF5FC;
  --surface: #fff;
  --surface-2: #F6F7F9;
  --page-bg: #fff;
  --page-bg-2: #F3F6FA;
  --track: #E9ECF1;
  --shadow: 0 1px 3px rgba(29, 35, 48, .08);
  --radius: 8px;
  --side-w: 236px;
  --side-w-mini: 64px;
  --font: "Manrope", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;

  /* Переменные Django admin */
  --primary: var(--blue);
  --secondary: var(--navy);
  --accent: var(--cyan);
  --primary-fg: #fff;
  --body-fg: var(--ink);
  --body-bg: var(--surface);
  --body-quiet-color: var(--muted);
  --body-medium-color: var(--ink-2);
  --body-loud-color: #1D2330;
  --header-color: #fff;
  --header-branding-color: #fff;
  --header-bg: var(--navy);
  --header-link-color: #fff;
  --breadcrumbs-fg: var(--muted);
  --breadcrumbs-link-fg: var(--teal);
  --breadcrumbs-bg: transparent;
  --link-fg: var(--teal);
  --link-hover-color: var(--blue);
  --link-selected-fg: var(--blue);
  --hairline-color: var(--line);
  --border-color: var(--line-2);
  --error-fg: var(--red);
  --message-success-bg: #E8F4EA;
  --message-warning-bg: #FDF1E2;
  --message-error-bg: #FBE9E9;
  --darkened-bg: var(--side-bg);
  --selected-bg: var(--sel);
  --selected-row: var(--row-sel);
  --button-fg: #fff;
  --button-bg: var(--blue);
  --button-hover-bg: var(--blue-dark);
  --default-button-bg: var(--blue);
  --default-button-hover-bg: var(--blue-dark);
  --close-button-bg: #8A8F99;
  --close-button-hover-bg: #6E737D;
  --delete-button-bg: var(--red);
  --delete-button-hover-bg: #A32020;
  --object-tools-fg: var(--ink-2);
  --object-tools-bg: var(--surface);
  --object-tools-hover-bg: var(--hover);
  --font-family-primary: var(--font);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { background: var(--page-bg); }
body {
  margin: 0;
  font: 14px/1.45 var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; }
a:hover, a:focus { color: var(--blue); text-decoration: none; }
h1, h2, h3, h4, h5 { font-family: var(--font); color: var(--body-loud-color); }
.i { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.lead { font-size: 15px; margin: 0 0 20px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---------- Боковое меню ---------- */
.side {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: var(--side-w);
  display: flex; flex-direction: column;
  background: var(--side-bg);
  border-right: 1px solid var(--line);
  transition: width .18s ease, transform .2s ease;
  overflow: hidden;
}
.side-brand { display: flex; align-items: center; height: 60px; padding: 0 20px; flex: none; }
.side-brand .logo-full { height: 22px; width: auto; }
.side-brand .logo-mini { display: none; width: 30px; height: 30px; }
.side-caption {
  padding: 0 20px 14px; margin-top: -8px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
.side-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 8px; }
.nav-sect { margin-top: 2px; }
.nav-group {
  display: flex; align-items: center; gap: 12px;
  width: 100%; height: 40px; padding: 0 16px 0 20px; margin: 0;
  border: 0; background: none; cursor: pointer;
  font: 600 14px/1 var(--font); color: var(--ink-2);
  white-space: nowrap; text-align: left;
}
.nav-group .i { color: #8A8F99; }
.nav-group:hover { background: #ECEEF2; color: var(--ink); }
.nav-group .label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-count {
  min-width: 20px; padding: 2px 6px; border-radius: 10px;
  background: var(--track); color: var(--muted); font-size: 11px; font-weight: 700; text-align: center;
}
.nav-group .nav-chevron { width: 16px; height: 16px; transition: transform .2s ease; }
.nav-sect.open > .nav-group { color: var(--ink); }
.nav-sect.open > .nav-group .nav-chevron { transform: rotate(180deg); }
.nav-sect.open > .nav-group .nav-count { display: none; }
.nav-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease; }
.nav-sub > div { overflow: hidden; min-height: 0; }
.nav-sect.open > .nav-sub { grid-template-rows: 1fr; }
.nav-sub .nav-item { height: 36px; padding-left: 32px; font-size: 13.5px; }
.nav-sub .nav-item .i { width: 16px; height: 16px; }
.nav-sect.open > .nav-sub > div { padding-bottom: 4px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%; height: 40px; padding: 0 20px; margin: 0;
  border: 0; background: none; cursor: pointer;
  font: 500 14px/1 var(--font); color: var(--ink-2);
  white-space: nowrap; text-align: left;
}
.side a.nav-item:link, .side a.nav-item:visited { color: var(--ink-2); }
.side a.nav-item.active:link, .side a.nav-item.active:visited { color: var(--blue); }
.nav-item .i { color: #8A8F99; }
.nav-item:hover, .nav-item:focus { background: #ECEEF2; color: var(--ink); }
.nav-item:hover .i { color: var(--blue); }
.nav-item.active { background: var(--sel); color: var(--blue); font-weight: 700; }
.nav-item.active .i { color: var(--blue); }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--blue);
}
.nav-form { margin: 0; }
.side-bottom { flex: none; padding: 8px 0 10px; border-top: 1px solid var(--line); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px 16px 10px; white-space: nowrap; }
.avatar {
  flex: none; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--blue) 60%, var(--cyan));
  color: #fff; font-size: 12px; font-weight: 700;
}
.side-user .label { display: flex; flex-direction: column; min-width: 0; }
.side-user b { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.side-user small { font-size: 12px; color: var(--muted); }
.side-toggle .i { transition: transform .18s ease; }
.side-actions { display: flex; gap: 2px; padding: 0 10px; }
.side-actions > .nav-item, .side-actions > .nav-form { flex: 1; }
.side .side-actions .nav-item { justify-content: center; height: 38px; padding: 0; border-radius: 8px; }
.side .side-actions .label { display: none; }
.side-collapsed .side-actions { flex-direction: column; gap: 0; padding: 0; }
.side-collapsed .side-actions > * { flex: none; }
.side-collapsed .side .side-actions .nav-item { border-radius: 0; }

.shell { margin-left: var(--side-w); min-height: 100vh; transition: margin-left .18s ease; }
body:not(.has-side) .shell { margin-left: 0; }

/* Свёрнутое меню — только иконки */
.side-collapsed .side { width: var(--side-w-mini); }
.side-collapsed .shell { margin-left: var(--side-w-mini); }
.side-collapsed .side .label,
.side-collapsed .side-caption,
.side-collapsed .side-brand .logo-full { display: none; }
.side-collapsed .side-brand { justify-content: center; padding: 0; }
.side-collapsed .side-brand .logo-mini { display: block; }
.side-collapsed .nav-group { height: 1px; padding: 0; margin: 10px 14px; width: calc(100% - 28px); background: var(--line); pointer-events: none; }
.side-collapsed .nav-group > * { display: none; }
.side-collapsed .nav-sub { grid-template-rows: 1fr; }
.side-collapsed .nav-sub .nav-item { padding-left: 0; height: 40px; }
.side-collapsed .nav-item { justify-content: center; padding: 0; }
.side-collapsed .side-user { justify-content: center; padding: 8px 0 10px; }
.side-collapsed .side-toggle .i { transform: rotate(180deg); }

.mobile-bar { display: none; }
.side-overlay { display: none; }

/* ---------- Содержимое ---------- */
.content { display: block; padding: 0 28px 40px; }
#content { padding: 0; margin: 0; }
.crumbs:empty { display: none; }
.crumbs .breadcrumbs {
  padding: 16px 0 0; margin: 0; background: none; border: 0;
  font-size: 12px; color: var(--muted);
}
.crumbs .breadcrumbs a { color: var(--teal); }
.page-head {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  min-height: 64px; padding: 12px 0; margin: 0;
  background: var(--page-bg);
}
.crumbs:not(:empty) + .messagelist + #content .page-head,
.crumbs:not(:empty) + #content .page-head { padding-top: 6px; }
.page-head h1 {
  margin: 0; padding: 0;
  font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em;
  color: var(--body-loud-color);
}
.page-subtitle { font-size: 14px; font-weight: 500; color: var(--muted); margin: -6px 0 12px; }
.page-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#content h1 { font-weight: 700; }

/* Кнопки */
.icon-btn, .square-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.icon-btn:hover, .square-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--hover); }
.icon-btn.disabled { opacity: .4; pointer-events: none; }
.icon-btn.flip .i { transform: rotate(180deg); }
.square-btn.addlink { color: var(--blue); }
.square-btn.addlink:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.square-btn.back { color: var(--ink-2); }
.tool-btn, .btn, .tool-link {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-2);
  font: 600 13px/1 var(--font); cursor: pointer; white-space: nowrap;
}
.tool-btn:hover, .btn:hover { border-color: var(--blue); color: var(--blue); background: var(--hover); }
.tool-btn .i, .btn .i, .tool-link .i { width: 16px; height: 16px; }
.tool-btn.is-active { border-color: var(--blue); color: var(--blue); background: var(--sel); }
.tool-btn.is-active::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.tool-link { border-color: transparent; padding: 0 8px; color: var(--muted); background: none; }
.tool-link:hover { color: var(--red); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn-block { width: 100%; justify-content: center; height: 42px; font-size: 14px; }

/* Кнопки-инструменты Django рядом с заголовком */
.page-head ul.object-tools {
  position: static; float: none; display: flex; gap: 8px;
  margin: 0; padding: 0; list-style: none;
}
.page-head ul.object-tools li { display: block; margin: 0; padding: 0; height: auto; }
.page-head ul.object-tools a,
.page-head ul.object-tools a:link,
.page-head ul.object-tools a:visited {
  float: none; padding: 0 14px; border-radius: var(--radius);
  background: var(--surface); color: var(--ink-2); font: 600 13px/1 var(--font);
  text-transform: none; letter-spacing: 0; border: 1px solid var(--line-2);
}
.page-head ul.object-tools a.tool-btn { display: inline-flex; height: 34px; line-height: 1; }
.page-head ul.object-tools a.square-btn { padding: 0; display: inline-grid; color: var(--blue); }
.page-head ul.object-tools a.square-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.page-head ul.object-tools a.tool-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--hover); }
.page-head ul.object-tools a.addlink, .page-head ul.object-tools a.historylink { background-image: none; }

/* Поиск и пагинация */
form.search { display: flex; gap: 6px; margin: 0; }
form.search input[type=search] {
  width: 240px; height: 34px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  font: 13px var(--font); color: var(--ink); background: var(--surface);
}
form.search input[type=search]:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20,177,231,.18); outline: 0; }
.pager { display: flex; align-items: center; gap: 4px; }
.pager .icon-btn { width: 30px; height: 30px; border-color: transparent; }
.pager .icon-btn:hover { border-color: var(--line-2); }
.pager .icon-btn .i { width: 16px; height: 16px; }
.pager-info { min-width: 92px; text-align: center; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.per-page { margin: 0 0 0 4px; }
.per-page select, .filter-bar select, .filter-bar input {
  height: 34px; padding: 0 30px 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  font: 13px var(--font); color: var(--ink); background: var(--surface);
}
.search-note { margin: 0 0 10px; font-size: 13px; color: var(--muted); }

/* ---------- Список ---------- */
#changelist { display: block; margin: 0; padding: 0; border: 0; background: none; }
#changelist .changelist-form-container { width: auto; flex: 1; }
#changelist-form { margin: 0; }
.table-wrap { overflow-x: auto; }
#changelist table#result_list, #result_list { width: 100%; border-collapse: separate; border-spacing: 0; }
#result_list thead th {
  padding: 0; background: var(--surface);
  border: 0; border-bottom: 1px solid var(--line);
  font: 600 12px/1.3 var(--font); color: var(--muted);
  text-transform: none; letter-spacing: 0; vertical-align: middle;
}
#result_list thead th .text { padding: 0; }
#result_list thead th .text > a, #result_list thead th .text > span {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px; color: var(--muted); min-height: 40px;
}
#result_list thead th .text > a:hover { color: var(--ink); background: none; }
#result_list thead th.sortable .text > a::after {
  content: ""; flex: none; width: 10px; height: 14px; opacity: .55;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14'%3E%3Cpath d='M5 1 9 5H1zM5 13 1 9h8z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14'%3E%3Cpath d='M5 1 9 5H1zM5 13 1 9h8z'/%3E%3C/svg%3E") center/contain no-repeat;
}
#result_list thead th.sorted .text > a { color: var(--blue); }
#result_list thead th.sorted.ascending .text > a::after {
  opacity: 1;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14'%3E%3Cpath d='M5 1 9 5H1z'/%3E%3Cpath d='M5 13 1 9h8z' opacity='.25'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14'%3E%3Cpath d='M5 1 9 5H1z'/%3E%3Cpath d='M5 13 1 9h8z' opacity='.25'/%3E%3C/svg%3E");
}
#result_list thead th.sorted.descending .text > a::after {
  opacity: 1;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14'%3E%3Cpath d='M5 1 9 5H1z' opacity='.25'/%3E%3Cpath d='M5 13 1 9h8z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14'%3E%3Cpath d='M5 1 9 5H1z' opacity='.25'/%3E%3Cpath d='M5 13 1 9h8z'/%3E%3C/svg%3E");
}
#result_list thead th .sortoptions { display: none; }
#result_list thead th.action-checkbox-column { width: 44px; }
#result_list thead th.action-checkbox-column .text span { justify-content: center; padding: 10px 0; }
#result_list tbody td, #result_list tbody th {
  padding: 11px 12px; vertical-align: middle;
  border: 0; border-bottom: 1px solid var(--line);
  font-size: 13px; line-height: 1.35; color: var(--ink);
  background: var(--surface);
}
#result_list tbody th a:link, #result_list tbody th a:visited { color: var(--ink); font-weight: 700; }
#result_list td.field-address { min-width: 220px; }
#result_list td[class*="date"], #result_list td[class*="_at"], #result_list td[class*="badge"],
#result_list td.field-status_badge, #result_list th[class*="field-number"] { white-space: nowrap; }
#result_list tbody th a:hover { color: var(--blue); }
#result_list tbody tr:hover td, #result_list tbody tr:hover th { background: var(--hover); }
#result_list tbody tr.selected td, #result_list tbody tr.selected th { background: var(--row-sel); }
#result_list td.action-checkbox { width: 44px; text-align: center; padding-left: 0; padding-right: 0; }
#result_list tbody tr:nth-child(even) td, #result_list tbody tr:nth-child(even) th { background-color: var(--surface); }
#result_list tbody tr:nth-child(even):hover td, #result_list tbody tr:nth-child(even):hover th { background: var(--hover); }
#result_list tbody tr.selected:nth-child(even) td, #result_list tbody tr.selected:nth-child(even) th { background: var(--row-sel); }

/* Чекбоксы */
input[type=checkbox] {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; margin: 0; flex: none;
  border: 1.5px solid #B9BDC5; border-radius: 4px; background: var(--surface);
  cursor: pointer; vertical-align: middle; display: inline-grid; place-content: center;
  transition: background .12s, border-color .12s;
}
input[type=checkbox]:hover { border-color: var(--blue); }
input[type=checkbox]:checked {
  border-color: var(--blue);
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5 6.8 11 12 5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat;
}
input[type=checkbox]:indeterminate {
  border-color: var(--blue);
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8h8' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/14px no-repeat;
}

/* Переключатели «да/нет» — как в AXENTA CMS */
.switch, #result_list td input[type=checkbox]:not(.action-select),
.form-row .checkbox-row input[type=checkbox] {
  position: relative; display: inline-block;
  width: 32px; height: 18px; border-radius: 9px; border: 0;
  background: #D3D6DC; vertical-align: middle;
}
.switch::after, #result_list td input[type=checkbox]:not(.action-select)::after,
.form-row .checkbox-row input[type=checkbox]::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%; background: var(--surface);
  box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s;
}
.switch.on, #result_list td input[type=checkbox]:not(.action-select):checked,
.form-row .checkbox-row input[type=checkbox]:checked { background: var(--cyan); background-image: none; }
.switch.on::after, #result_list td input[type=checkbox]:not(.action-select):checked::after,
.form-row .checkbox-row input[type=checkbox]:checked::after { transform: translateX(14px); }
.switch.readonly { opacity: .9; }

/* Статусы */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 12px;
  font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap;
  background: #EEF0F3; color: var(--ink-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-blue { background: var(--sel); color: var(--blue); }
.badge-cyan { background: #DDF3FC; color: #0B7FA8; }
.badge-green { background: #E3F2E6; color: var(--green); }
.badge-darkgreen { background: #D7EBDB; color: #1D6B2B; }
.badge-orange { background: #FDEEDC; color: #B8650A; }
.badge-red { background: #FBE6E6; color: var(--red); }
.badge-gray { background: #EEF0F3; color: #6B7079; }

/* Групповые действия */
#changelist .actions {
  display: none; align-items: center; flex-wrap: wrap; gap: 10px;
  margin: 0 0 10px; padding: 8px 12px;
  border: 1px solid #C9DDF0; border-radius: var(--radius);
  background: var(--sel); color: var(--ink);
}
.has-selection #changelist .actions { display: flex; }
#changelist .actions label { margin: 0; font-size: 13px; }
#changelist .actions select {
  height: 32px; min-width: 260px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface);
  font: 13px var(--font);
}
#changelist .actions .button {
  height: 32px; padding: 0 14px; border-radius: var(--radius);
  background: var(--blue); color: #fff; border: 0; font: 600 13px var(--font); cursor: pointer;
}
#changelist .actions .action-counter { font-weight: 700; color: var(--blue); margin-right: 6px; }
#changelist .actions span.all, #changelist .actions span.clear, #changelist .actions span.question { font-size: 13px; }

/* Нижняя пагинация */
#changelist .paginator, .paginator {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  margin: 0; padding: 14px 0 0; border: 0; background: none;
  font-size: 13px; color: var(--muted); line-height: 1;
}
.paginator a:link, .paginator a:visited, .paginator .this-page, .paginator .end {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px;
  border-radius: var(--radius); background: none; color: var(--ink-2); font-weight: 600;
}
.paginator a:hover { background: var(--hover); color: var(--blue); }
.paginator .this-page { background: var(--blue); color: #fff; }
.paginator .showall { margin-left: 8px; }
.paginator input[type=submit] { margin-left: auto; }

/* Фильтры по датам */
#changelist .toplinks, .toplinks {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  margin: 0 0 10px; padding: 0; border: 0; background: none;
}
.toplinks a, .toplinks a:link {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 14px;
  font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface);
}
.toplinks a:hover { border-color: var(--blue); color: var(--blue); }
.toplinks .date-back { border-color: transparent; color: var(--teal); }

/* Панель фильтров (выезжает справа) */
#changelist-filter.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70;
  width: 340px; max-width: 92vw; margin: 0; padding: 0;
  display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line); border-radius: 0;
  box-shadow: -12px 0 32px rgba(29, 35, 48, .12);
  transform: translateX(105%); transition: transform .2s ease;
  order: 0; flex: none;
}
.filters-open #changelist-filter.drawer { transform: none; }
.drawer-overlay { display: none; position: fixed; inset: 0; z-index: 65; background: rgba(29, 35, 48, .25); }
.filters-open .drawer-overlay { display: block; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 16px 0 20px; border-bottom: 1px solid var(--line); flex: none; }
.drawer-head h2, #changelist-filter .drawer-head h2 {
  margin: 0; padding: 0; background: none; border: 0;
  font-size: 16px; font-weight: 700; color: var(--body-loud-color); text-transform: none; letter-spacing: 0;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 0 24px; }
.drawer-reset { display: flex; align-items: center; gap: 6px; padding: 10px 20px; font-size: 13px; font-weight: 600; color: var(--red); }
.drawer-reset .i { width: 14px; height: 14px; }
#changelist-filter details { border-bottom: 1px solid var(--line); margin: 0; padding: 0; }
#changelist-filter details > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; margin: 0;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2);
}
#changelist-filter details > summary::-webkit-details-marker { display: none; }
#changelist-filter details > summary::after {
  content: ""; width: 10px; height: 10px; border-right: 2px solid #9AA0A9; border-bottom: 2px solid #9AA0A9;
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s;
}
#changelist-filter details[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
#changelist-filter ul { margin: 0 0 10px; padding: 0; border: 0; }
#changelist-filter li { list-style: none; margin: 0; padding: 0; }
#changelist-filter li a, #changelist-filter a {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 20px 7px 36px; font-size: 13px; color: var(--ink-2); position: relative;
}
#changelist-filter li a:hover { background: var(--hover); color: var(--blue); }
#changelist-filter li.selected a { color: var(--blue); font-weight: 700; background: var(--sel); border: 0; margin: 0; padding-left: 36px; }
#changelist-filter li.selected a::before {
  content: ""; position: absolute; left: 16px; width: 12px; height: 12px; background: var(--blue);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5 6.5 12 13 4.5' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5 6.5 12 13 4.5' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
#changelist-filter h3 { display: none; }
/* Фильтры с выбором нескольких значений: квадрат-флажок у каждого значения */
#changelist-filter li.multi a::after {
  content: ""; position: absolute; left: 14px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  border: 1.5px solid var(--line-2, #B8BEC8); border-radius: 3px; box-sizing: border-box;
}
#changelist-filter li.multi.selected a::after { border-color: var(--blue); }
#changelist-filter li.multi.selected a::before { left: 15px; width: 12px; height: 12px; }

/* Пустой список */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 64px 16px; color: var(--muted); text-align: center; border-top: 1px solid var(--line); }
.empty .i { width: 40px; height: 40px; color: #C5C9D0; stroke-width: 1.5; }
.empty p { margin: 0; font-size: 14px; }

/* ---------- Сообщения ---------- */
ul.messagelist { margin: 12px 0 0; padding: 0; }
ul.messagelist li {
  margin: 0 0 8px; padding: 10px 14px 10px 14px;
  border: 0; border-left: 3px solid var(--green); border-radius: var(--radius);
  background: var(--message-success-bg); background-image: none;
  font-size: 13px; color: var(--ink);
}
ul.messagelist li.warning { border-left-color: var(--orange); background: var(--message-warning-bg); background-image: none; }
ul.messagelist li.error { border-left-color: var(--red); background: var(--message-error-bg); background-image: none; }
ul.messagelist li.info { border-left-color: var(--blue); background: var(--sel); background-image: none; }
.errornote {
  margin: 0 0 14px; padding: 10px 14px; border: 0; border-left: 3px solid var(--red);
  border-radius: var(--radius); background: var(--message-error-bg); background-image: none; color: var(--red); font-size: 13px;
}
ul.errorlist { margin: 4px 0 0; padding: 0; }
ul.errorlist li { background: none; padding: 0; color: var(--red); font-size: 12px; font-weight: 600; }

/* ---------- Карточка редактирования ---------- */
.change-form #content-main, .delete-confirmation #content, .change-form #content { max-width: 1100px; }
/* СНТ: таблица участков широкая — даём карточке больше места */
.change-form #content-main:has(#install_points-group),
.change-form #content:has(#install_points-group) {
  max-width: min(1680px, calc(100vw - 48px));
}
fieldset.module, .inline-group .module, .module {
  margin: 0 0 16px; padding: 0;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  overflow: hidden;
}
/* Не обрезать широкую таблицу участков — прокрутка внутри блока */
#install_points-group.inline-group .module {
  overflow: visible;
}
#changelist.module { border: 0; border-radius: 0; overflow: visible; }
fieldset.module > h2, fieldset.module details > summary > h2, .module h2, .module caption, .inline-group h2 {
  margin: 0; padding: 14px 18px;
  background: var(--side-bg); border: 0; border-bottom: 1px solid var(--line);
  font: 700 13px/1.3 var(--font); letter-spacing: .02em; text-transform: none; color: var(--body-loud-color);
}
fieldset.module details > summary { list-style: none; cursor: pointer; }
fieldset.module details > summary::-webkit-details-marker { display: none; }
fieldset.collapse summary h2::after, fieldset.module details > summary h2::after { content: " ▾"; color: var(--muted); }
.module h2 a, .module caption a { color: var(--body-loud-color); }
.form-row { padding: 12px 18px; border-bottom: 1px solid var(--line); overflow: visible; }
fieldset .form-row:last-child { border-bottom: 0; }
.aligned label, .aligned .flex-container > label, form .aligned label {
  width: 210px; padding: 8px 12px 0 0; font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.aligned label.required::after, form label.required::after { content: " *"; color: var(--orange); }
form .aligned div.help, form .aligned p.help, .help, p.help { margin-left: 222px; padding-left: 0; font-size: 12px; color: var(--muted); }
form .aligned div.readonly, .readonly { padding-top: 8px; font-size: 13px; color: var(--ink); }
.checkbox-row label, form .aligned .checkbox-row label { width: auto; padding: 0 0 0 10px; }
.form-row .checkbox-row { align-items: center; }
form .aligned .checkbox-row + div.help { margin-left: 0; }

input[type=text], input[type=password], input[type=email], input[type=url], input[type=number],
input[type=tel], input[type=date], input[type=time], input[type=search]:not(#searchbar), textarea, select, .vTextField {
  height: 36px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: 13px var(--font);
  box-shadow: none; transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 84px; padding: 8px 12px; line-height: 1.45; }
select[multiple] { height: auto; padding: 6px; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20,177,231,.18); outline: 0; }
.vTextField { width: min(520px, 100%); }
/* Поля плановых объёмов: стандартные 5em вмещают только 3 цифры */
.field-total_volume .vIntegerField, .field-volume .vIntegerField { width: 10em; }
.errors input, .errors select, .errors textarea { border-color: var(--red); }

/* Ссылки «Добавить ещё», календарь, связанные объекты */
.related-widget-wrapper { gap: 6px; align-items: center; }
.related-widget-wrapper-link { opacity: .7; }
.inline-group .tabular td.original p { color: var(--muted); }
.inline-group .tabular tr.add-row td, .inline-group div.add-row { padding: 10px 18px; background: var(--surface); border: 0; }
.inline-group div.add-row a, .inline-group .tabular tr.add-row td a { font-weight: 600; color: var(--blue); }
.inline-group .tabular table { width: 100%; }
.inline-group .tabular thead th { background: var(--surface); color: var(--muted); font: 600 12px var(--font); text-transform: none; border-bottom: 1px solid var(--line); padding: 10px 12px; }
.inline-group .tabular td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.inline-related h3 { margin: 0; padding: 10px 18px; background: var(--surface); border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 13px; }
/* Карточка наряда: без служебных подписей вида «WorkResult object (…)» — у результата, пломб, фото и истории */
#result-group .inline-related h3,
#seals-group td.original p, #photos-group td.original p, #history-group td.original p { display: none; }
.inline-group { margin-bottom: 16px; }

/* Участки монтажа СНТ: компактная таблица + горизонтальная прокрутка, чтобы колонки помещались */
#install_points-group .tabular {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
#install_points-group .tabular table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}
#install_points-group .tabular thead th,
#install_points-group .tabular td {
  padding: 6px 6px;
  vertical-align: middle;
  white-space: nowrap;
}
#install_points-group .tabular thead th {
  font-size: 11px;
  line-height: 1.25;
  text-align: left;
  vertical-align: bottom;
}
/* Заголовок — ровно над полем: без значков подсказок и подписи участка над строкой */
#install_points-group .tabular thead th img.help-tooltip,
#install_points-group td.original p { display: none; }
#install_points-group .tabular tr.has_original td { padding-top: 6px; }
#install_points-group .tabular th.original,
#install_points-group .tabular td.original { width: 0; padding: 0; }
.ip-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
#install_points-group .tabular input[type=text],
#install_points-group .tabular input[type=number],
#install_points-group .tabular select,
#install_points-group .tabular .vTextField {
  width: 100%;
  min-width: 0;
  max-width: 120px;
  height: 30px;
  padding: 0 6px;
  font-size: 12px;
}
#install_points-group .tabular .field-position .vIntegerField,
#install_points-group .tabular .field-position input {
  max-width: 44px;
}
#install_points-group .tabular .field-plot input { max-width: 64px; }
#install_points-group .tabular .field-subscriber_phone input { max-width: 110px; }
#install_points-group .tabular .field-account_number input { max-width: 90px; }
#install_points-group .tabular .field-address input,
#install_points-group .tabular .field-subscriber_name input,
#install_points-group .tabular .field-note input,
#install_points-group .tabular .field-install_place input,
#install_points-group .tabular .field-unable_reason input {
  max-width: 140px;
}
#install_points-group .tabular .field-meter_phase select { max-width: 112px; }
#install_points-group .tabular .field-breaker_rating input { max-width: 80px; }
#install_points-group .tabular .field-status select { max-width: 100px; }
#install_points-group .tabular .field-new_meter_serial input,
#install_points-group .tabular .field-new_meter_model input,
#install_points-group .tabular .field-new_meter_initial_reading input {
  max-width: 100px;
}
#install_points-group .tabular td.delete { width: 28px; padding-left: 4px; padding-right: 4px; }
.selector .selector-available h2, .selector .selector-chosen h2 { padding: 10px 12px; font-size: 13px; }
.selector-chosen h2 { background: var(--blue); color: #fff; }
.selector .selector-filter { padding: 8px; border-color: var(--line); }
.selector select { border-radius: 0 0 var(--radius) var(--radius); }
.selector-chooseall, .selector-clearall { font-weight: 600; }

/* Нижняя панель кнопок формы */
.submit-row {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 8px 0 0; padding: 14px 0;
  background: rgba(255,255,255,.96); border: 0; border-top: 1px solid var(--line); border-radius: 0;
  backdrop-filter: blur(6px);
}
.submit-row input, .submit-row a.closelink, .submit-row a.deletelink, .button, input[type=submit], input[type=button], button.button {
  height: 36px; padding: 0 16px; margin: 0;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-2); font: 600 13px/34px var(--font);
  cursor: pointer; text-transform: none; letter-spacing: 0;
}
.submit-row input:hover, .button:hover, input[type=submit]:hover, input[type=button]:hover { border-color: var(--blue); color: var(--blue); background: var(--hover); }
.submit-row input.default, input[type=submit].default, .button.default, #changelist .paginator input.default {
  float: none; background: var(--blue); border-color: var(--blue); color: #fff;
}
.submit-row input.default:hover, input[type=submit].default:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.submit-row a.deletelink {
  margin-left: auto; display: inline-flex; align-items: center;
  border-color: transparent; background: none; color: var(--red);
}
.submit-row a.deletelink:hover { background: var(--message-error-bg); color: var(--red); }
.submit-row a.closelink { display: inline-flex; align-items: center; }
.delete-confirmation form input[type=submit] { background: var(--red); border-color: var(--red); color: #fff; }
.delete-confirmation form .cancel-link {
  display: inline-flex; align-items: center; height: 36px; padding: 0 16px; margin-left: 8px;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); color: var(--ink-2); font-weight: 600;
}
.delete-confirmation ul { padding-left: 18px; }

/* ---------- Главная, реестры, дашборд ---------- */
.section-title { margin: 24px 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tile {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  color: var(--ink); transition: border-color .12s, box-shadow .12s, transform .12s;
}
.tile:hover { border-color: #B9D3EC; box-shadow: 0 6px 18px rgba(0, 91, 170, .08); color: var(--ink); }
.tile-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--sel); color: var(--blue); flex: none; }
.tile-title { flex: 1; display: flex; flex-direction: column; gap: 2px; font-weight: 700; font-size: 14px; }
.tile-title small { font-weight: 500; font-size: 12px; color: var(--muted); }
.tile .tile-arrow { color: #B4B9C2; width: 16px; height: 16px; }
.tile:hover .tile-arrow { color: var(--blue); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--side-bg); }
.filter-bar label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.filter-bar select { min-width: 160px; }
.filter-bar input[type=date] { padding: 0 10px; }
.period-note { margin: -4px 0 14px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.uspd-metrics .kpi { text-decoration: none; }
.uspd-metrics .kpi:is(:hover, :focus-visible, [aria-current="page"]) { border-color: var(--blue); }
.kpi-head { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.kpi-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; flex: none; }
.kpi-icon .i { width: 17px; height: 17px; }
.kpi-icon.blue { background: var(--sel); color: var(--blue); }
.kpi-icon.cyan { background: #DDF3FC; color: #0B7FA8; }
.kpi-icon.navy { background: #E2E7F5; color: var(--navy); }
.kpi-icon.orange { background: #FDEEDC; color: #C46D0C; }
.kpi-value { font-size: 32px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; color: var(--body-loud-color); font-variant-numeric: tabular-nums; }
.kpi-value span { font-size: 20px; font-weight: 600; color: var(--muted); }
.kpi-sub { font-size: 13px; color: var(--ink-2); }
.kpi-note { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi-link { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 700; color: var(--blue); }
.kpi-link .i { width: 15px; height: 15px; }
.kpi-table { width: 100%; border-collapse: collapse; }
.kpi-table td { padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.kpi-table td.n { text-align: right; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-green { background: #3BB54A; box-shadow: 0 0 0 3px rgba(59,181,74,.18); }
.progress { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.progress.orange > span { background: linear-gradient(90deg, #E07B0A, #F2A54B); }

.card { margin: 0 0 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-title { margin: 0 0 8px; font-size: 15px; font-weight: 700; color: var(--body-loud-color); }
.card-head .card-title { margin: 0; }
.cards-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-plan, .bar-plan { background: #CFE0F2; }
.sw-fact, .bar-fact { background: var(--blue); }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding-top: 8px; overflow-x: auto; }
.chart-col { flex: 1 0 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart-bars { display: flex; align-items: flex-end; gap: 2px; width: 100%; height: 140px; }
.chart-bars { justify-content: center; }
.chart-bars span { flex: 1; max-width: 16px; min-height: 2px; border-radius: 3px 3px 0 0; }
.chart-col:hover .bar-fact { background: var(--cyan); }
.chart-label { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.plain-table { width: 100%; border-collapse: collapse; }
.plain-table td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.plain-table td.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plain-table .w-name { width: 40%; font-weight: 600; }
.plain-table .w-num { width: 150px; }
.plain-table th { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600;
                  color: var(--muted, #6B7280); text-align: left; white-space: nowrap; }
.plain-table th.n { text-align: right; }
.avr-table .progress { min-width: 80px; }
.plans-toggle { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.plans-toggle .i { width: 15px; height: 15px; flex: none; color: var(--muted); transition: transform .15s; }
.plans-toggle[aria-expanded="true"] .i { transform: rotate(90deg); }
.plans-toggle:hover b { color: var(--blue); }
.completion-table .plan-row td { padding-top: 6px; padding-bottom: 6px; color: var(--ink-2); }
.completion-table .plan-row .w-name { padding-left: 19px; font-weight: 400; }
.plain-list { margin: 0 0 12px; padding: 0; list-style: none; }
.plain-list li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.stack-form > div { margin-bottom: 14px; }
.stack-form label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.stack-form select { width: 100%; max-width: 420px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Вход ---------- */
body.login { background: var(--surface); }
body.login .content { padding: 0; }
body.login #content { padding: 0; }
body.login #content > br.clear { display: none; }
.login-form {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; min-height: 100dvh; box-sizing: border-box;
  padding: 40px 24px; background: var(--surface);
}
.login-card { width: 100%; max-width: 380px; }
.login-logo { height: 30px; width: auto; margin-bottom: 36px; }
.login-card h1 { margin: 0 0 22px; font-size: 24px; font-weight: 800; color: var(--body-loud-color); letter-spacing: -.01em; }
.login-card .field { display: block; margin-bottom: 14px; }
.login-card .field span { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.login-card .field input { width: 100%; height: 42px; font-size: 14px; }
.login-card .btn-block { margin-top: 8px; }
.login-note { margin: 22px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }

/* ---------- Всплывающие окна выбора (popup) ---------- */
body.popup .content { padding: 0 20px 20px; }
body.popup .page-head { position: static; }

fieldset.module .description { margin: 0; padding: 12px 18px 0; font-size: 12px; color: var(--muted); }

/* Наряд: плановая дата и время визита «с» и «по» — одной строкой */
div.form-row.field-visit_from > .form-multiline { flex-wrap: nowrap; align-items: flex-start; gap: 24px; }
div.form-row.field-visit_from .fieldBox { margin: 0; }
form .aligned div.form-row.field-visit_from label.inline { width: auto; min-width: 0; padding-right: 8px; }
div.form-row.field-visit_from input[type=date] { width: 160px; }
div.form-row.field-visit_from .time-select { display: inline-flex; align-items: center; gap: 4px; }
div.form-row.field-visit_from .time-select select { width: 64px; padding: 0 6px; }
div.form-row.field-visit_from .time-sep { font-weight: 600; color: var(--ink-2); }

/* Строки списков открываются нажатием в любом месте (cabinet.js). */
#result_list tbody tr.row-link { cursor: pointer; }

/* ---------- Адаптивность ---------- */
@media (max-width: 1024px) {
  form.search input[type=search] { width: 180px; }
  .aligned label, .aligned .flex-container > label, form .aligned label { width: 160px; }
  form .aligned div.help, form .aligned p.help, .help, p.help { margin-left: 172px; }
}
@media (max-width: 900px) {
  .shell, .side-collapsed .shell { margin-left: 0; }
  .side, .side-collapsed .side { width: 260px; transform: translateX(-100%); box-shadow: 0 0 40px rgba(0,0,0,.18); }
  .side-collapsed .side .label, .side-collapsed .side-caption { display: revert; }
  .side-collapsed .side-brand .logo-full { display: block; }
  .side-collapsed .side-brand .logo-mini { display: none; }
  .side-collapsed .side-brand { justify-content: flex-start; padding: 0 20px; }
  .side-collapsed .nav-item { justify-content: flex-start; padding: 0 20px; }
  .side-collapsed .nav-group { height: 40px; margin: 0; padding: 0 16px 0 20px; width: 100%; background: none; pointer-events: auto; }
  .side-collapsed .nav-group > * { display: revert; }
  .side-collapsed .nav-sub { grid-template-rows: 0fr; }
  .side-collapsed .nav-sect.open > .nav-sub { grid-template-rows: 1fr; }
  .side-collapsed .nav-sub .nav-item { padding-left: 32px; height: 36px; }
  .side-collapsed .side-user { justify-content: flex-start; padding: 8px 16px 10px; }
  .side-toggle { display: none; }
  .side-collapsed .side-actions { flex-direction: row; padding: 0 10px; }
  .side-collapsed .side-actions > * { flex: 1; }
  .side-open .side { transform: none; }
  .side-open .side-overlay { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(29,35,48,.3); }
  .mobile-bar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 16px;
    background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .mobile-bar img { height: 18px; }
  .content { padding: 0 16px 32px; }
  .page-head { position: static; min-height: 56px; }
  .page-tools { margin-left: 0; width: 100%; }
  form.search { flex: 1; }
  form.search input[type=search] { width: 100%; flex: 1; }
}
@media (max-width: 767px) {
  .aligned label, .aligned .flex-container > label, form .aligned label { width: 100%; padding: 0 0 6px; }
  form .aligned div.help, form .aligned p.help, .help, p.help { margin-left: 0; }
  .form-row { padding: 12px 14px; }
  .pager-info { min-width: 0; }
  div.form-row.field-visit_from > .form-multiline { flex-wrap: wrap; gap: 0; }
  .kpi-value { font-size: 28px; }
}

/* ---------- Уточнения ---------- */
#changelist-filter details > summary::before { content: none; display: none; }
#result_list td.field-project { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#result_list tbody td, #result_list tbody th { padding-left: 10px; padding-right: 10px; }
.submit-row input, .submit-row input.default { text-transform: none; letter-spacing: 0; }
textarea { max-height: 160px; }
textarea.vLargeTextField { height: 96px; }
.related-widget-wrapper-link img { filter: grayscale(1); opacity: .55; }
.related-widget-wrapper-link:hover img { filter: none; opacity: 1; }
.datetimeshortcuts a { font-weight: 600; }
a.tile:link, a.tile:visited, a.tile:hover { color: var(--ink); }
a.kpi-link:link, a.kpi-link:visited { color: var(--blue); }

/* Списки флажков (например, «Что отправлять» в канале мессенджера) */
form .aligned label:has(> input[type=checkbox]) {
  width: auto; display: flex; align-items: center; gap: 8px; padding: 5px 0; font-weight: 500; color: var(--ink);
}
#id_events, div[id$="-events"] { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 0 24px; }
@media (max-width: 767px) { #id_events, div[id$="-events"] { grid-template-columns: 1fr; } }

/* Загрузка файлов */
.stack-form .helptext { display: block; margin: 0 0 8px; font-size: 12px; color: var(--muted); }
input[type=file] { font: 13px var(--font); color: var(--ink-2); max-width: 100%; }
input[type=file]::file-selector-button {
  height: 34px; margin-right: 12px; padding: 0 14px; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface);
  font: 600 13px var(--font); color: var(--blue);
}
input[type=file]::file-selector-button:hover { border-color: var(--blue); background: var(--hover); }

/* ---------- Карта ---------- */
.layer-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.status-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.status-chips .chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 8px;
  border: 1px solid var(--line-2); border-radius: 15px; background: var(--surface);
  font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.status-chips .chip i { width: 10px; height: 10px; border-radius: 50%; }
.status-chips .chip input { width: 14px; height: 14px; }
.status-chips .chip:has(input:not(:checked)) { opacity: .55; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; margin-bottom: 8px; }
.map-layout.no-panel { grid-template-columns: minmax(0, 1fr); }
.map-panel[hidden] { display: none; }
.map-canvas { height: calc(100vh - 290px); min-height: 420px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; z-index: 0; }
.map-panel { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); max-height: calc(100vh - 290px); min-height: 420px; }
.map-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 14px 14px 8px; }
.map-panel-head .card-title { margin: 0; }
.map-installers { flex: 1; overflow-y: auto; padding: 0 6px; }
.map-person-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; margin: 0;
  border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
}
.map-person-row:hover:not([disabled]) { background: var(--hover); }
.map-person-row[disabled] { cursor: default; opacity: .6; }
.map-person-name { flex: 1; display: flex; flex-direction: column; font-size: 13px; font-weight: 700; min-width: 0; }
.map-person-name small { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-panel-foot { padding: 8px 14px; border-top: 1px solid var(--line); }
.map-panel-foot:empty { display: none; }
.map-legend { display: flex; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot-state { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #C3C7CE; }
.dot-state.fresh { background: #2E8B3E; }
.dot-state.stale { background: var(--orange); }
.dot-state.old, .dot-state.none { background: #A3A8B1; }

.map-order span { display: block; width: 14px; height: 14px; margin: 2px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.map-order.pnr span { width: 13px; height: 13px; margin: 3px; border-radius: 3px; transform: rotate(45deg); }
.map-cluster.pnr span { border-radius: 10px; border-style: dashed; }
.status-chips[hidden] { display: none; }
.status-chips .chips-label { align-self: center; font-size: 12px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.status-chips .chip input[type="date"] { width: auto; height: 24px; padding: 0 4px; border: 1px solid var(--line-2); border-radius: 6px; font: inherit; }
.status-chips.day-chips .chip { padding: 0 12px 0 8px; }
.status-chips .chip:has(input[type="radio"]:not(:checked)) { opacity: .7; }
.status-chips .chip:has(input[type="radio"]:checked) { opacity: 1; border-color: var(--blue); color: var(--blue); }
.status-chips .chip i.pnr-mark { border-radius: 2px; transform: rotate(45deg); width: 9px; height: 9px; }
.map-cluster span {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  background: var(--surface); border: 4px solid var(--blue); box-shadow: 0 2px 8px rgba(0,0,0,.25);
  font: 800 13px var(--font); color: var(--ink);
}
.map-person span {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff;
  font: 800 12px var(--font); border: 3px solid #A3A8B1; box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.map-person.fresh span { border-color: #3BB54A; }
.map-person.stale span { border-color: var(--orange); }
.map-vehicle span {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #0B6E4F, #14B1E7); color: #fff;
  font: 800 11px var(--font); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.map-pop { display: grid; gap: 4px; font: 13px/1.4 var(--font); color: var(--ink); min-width: 220px; }
.map-pop-title { font-weight: 800; font-size: 14px; color: var(--body-loud-color); }
a.map-pop-title { color: var(--blue); }
.leaflet-container { font-family: var(--font); }
.map-wrap { position: relative; min-width: 0; }
.map-track-info {
  position: absolute; z-index: 500; top: 10px; left: 56px; right: 10px; width: fit-content; max-width: calc(100% - 66px);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 6px 6px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.15);
  font-size: 13px; color: var(--ink);
}
.map-track-info[hidden] { display: none; }
.map-track-info .icon-btn { width: 28px; height: 28px; font-size: 18px; line-height: 1; }
.map-pop .btn-small { margin-top: 4px; height: 30px; padding: 0 12px; font-size: 13px; }
.leaflet-popup-content-wrapper { border-radius: 10px; }
/* Карта: назначение монтажника из карточки наряда */
/* Ширину строки задаёт подсказка, а не самое длинное ФИО в списке — кнопка «Сохранить» не вылезает за край */
.map-pop > * { min-width: 0; }
.map-assign { display: grid; gap: 4px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.map-assign-row { display: flex; gap: 6px; align-items: center; min-width: 0; }
.map-assign-row select { flex: 1 1 0; width: 0; min-width: 0; height: 30px; font: 13px var(--font); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; text-overflow: ellipsis; }
.map-assign-row .btn-small { flex: none; margin-top: 0; white-space: nowrap; }
.map-assign-ok { color: #2E8B3E; }
.map-assign-err { color: #C62828; }
/* Карта: выбор монтажников (несколько) */
.multi-pick { position: relative; }
.multi-pick > summary { list-style: none; max-width: 360px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: inline-flex; }
.multi-pick > summary::-webkit-details-marker { display: none; }
.multi-pick > summary::after { content: "▾"; margin-left: 4px; color: var(--muted); }
.multi-pick[data-active] > summary { border-color: var(--blue); color: var(--blue); }
.multi-pick-pop {
  position: absolute; z-index: 1000; top: 34px; left: 0; width: 300px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.multi-pick-pop input[type="search"] { width: 100%; height: 32px; margin-bottom: 6px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 6px; font: inherit; box-sizing: border-box; }
.multi-pick-list { max-height: 280px; overflow-y: auto; }
.multi-pick-list label { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.multi-pick-list label:hover { background: var(--hover); }
.multi-pick-list label[hidden] { display: none; }
.multi-pick-foot { padding-top: 6px; border-top: 1px solid var(--line); margin-top: 6px; }
/* Список нарядов кружка-группы при наведении */
.map-cluster-list { min-width: 260px; max-width: 340px; gap: 2px; }
.map-cluster-list a { display: grid; grid-template-columns: 10px 1fr; column-gap: 8px; padding: 5px 6px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.map-cluster-list a:hover { background: var(--hover); }
.map-cluster-list a i { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; grid-row: span 3; }
.map-cluster-list a b { color: var(--blue); }
.map-cluster-list a span, .map-cluster-list a small { grid-column: 2; }
.map-cluster-list a small { color: var(--muted); }
@media (max-width: 900px) {
  .map-layout { grid-template-columns: 1fr; }
  .map-canvas { height: 60vh; }
  .map-panel { max-height: none; min-height: 0; }
}

/* Конструктор отчётов */
.rb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.rb-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.rb-field input, .rb-field select { width: 100%; }
.rb-columns { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(220px, 320px); gap: 16px; align-items: start; }
.rb-selected { margin: 0; padding: 0; list-style: none; counter-reset: rb; }
.rb-selected li { display: flex; align-items: center; gap: 6px; padding: 6px 8px; margin: 0 0 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--side-bg); counter-increment: rb; }
.rb-selected li::before { content: counter(rb); min-width: 20px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.rb-selected li span { flex: 1; font-size: 13px; }
.rb-selected .icon-btn { width: 28px; height: 28px; }
.rb-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 10px; }
.rb-check { display: flex; align-items: center; gap: 6px; margin: 6px 0; font-size: 13px; }
.rb-submit { margin: 4px 0 24px; }
.report-actions { display: flex; gap: 6px; justify-content: flex-end; }
.report-actions form { margin: 0; }
.report-table-wrap { padding: 0; overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th { position: sticky; top: 0; padding: 8px 10px; text-align: left; background: var(--side-bg); border-bottom: 1px solid var(--line); white-space: nowrap; }
.report-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.report-table tfoot td { font-weight: 700; }
@media (max-width: 760px) { .rb-columns { grid-template-columns: 1fr; } }
a.btn-primary:link, a.btn-primary:visited { color: #fff; }
.report-table td { min-width: 110px; }

/* Дашборд: переключатель «Монтажи / ПНР» и диаграммы ПНР */
.dash-tabs { display: inline-flex; gap: 4px; margin: 0 0 12px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--side-bg); }
.dash-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 7px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.dash-tab .i { width: 16px; height: 16px; }
.dash-tab:hover { color: var(--blue); background: var(--surface); }
.dash-tab.active { background: var(--surface); color: var(--blue); box-shadow: 0 1px 3px rgba(29, 35, 48, .12); }
a.dash-tab:link, a.dash-tab:visited { color: var(--ink-2); }
a.dash-tab.active:link, a.dash-tab.active:visited, a.dash-tab:hover { color: var(--blue); }
.kpi-icon.green { background: #E3F2E6; color: var(--green); }
.kpi-icon.red { background: #FBE4E4; color: var(--red); }
.progress.green > span { background: linear-gradient(90deg, #2E9E44, #58C46B); }
.sw-online, .bar-online, .seg-online { background: #2E9E44; }
.sw-silent, .seg-silent { background: var(--red); }
.sw-unknown, .seg-unknown { background: #C9CED6; }
.chart-col:hover .bar-online { background: #58C46B; }
.kpi-table .sw { margin-right: 4px; vertical-align: -1px; }
.stack { display: flex; gap: 2px; height: 22px; border-radius: 5px; overflow: hidden; background: var(--track); }
.stack .seg { display: flex; align-items: center; justify-content: center; min-width: 2px; overflow: hidden;
  font-size: 11px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stack .seg-unknown { color: var(--ink); }
/* Не опрашивается — со штриховкой, чтобы отличать от «на связи» не только цветом */
.stack .seg-silent { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.22) 0 3px, transparent 3px 7px); }
.hbars { width: 100%; border-collapse: collapse; }
.hbars td { padding: 6px 8px 6px 0; font-size: 13px; vertical-align: middle; }
.hbars td.n { width: 1%; text-align: right; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
.hbars td.n .muted { font-weight: 500; }
.hbars .hb-label { width: 34%; color: var(--ink-2); }
.hb-track { height: 14px; }
.hb-bar { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--blue); }
.hb-bar.hb-old { background: var(--red); }
.hb-bar.hb-gray { background: #AEB4BE; }
.hb-split { display: flex; overflow: hidden; }
.hb-in { display: block; height: 100%; background: #2E9E44; border-right: 2px solid var(--surface); }
.hbars tr:hover .hb-bar { filter: brightness(1.12); }
@media (max-width: 767px) {
  .card-head { flex-wrap: wrap; }
  .pnr-projects tr { display: grid; grid-template-columns: 1fr auto; border-bottom: 1px solid var(--line); }
  .pnr-projects td { border-bottom: 0; }
  .pnr-projects .w-name { width: auto; }
  .pnr-projects td.w-stack { grid-column: 1 / -1; grid-row: 2; padding-top: 0; }
}

/* Календарь монтажей СНТ/ТСЖ/ЖСК */
.calendar-card .card-head { gap: 16px; }
.cal-grid {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.cal-head-row {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px;
}
.cal-head {
  padding: 8px 6px; background: #F4F6F9; text-align: center;
  font-size: 12px; font-weight: 700; color: var(--ink-2);
}
.cal-week {
  --lane-count: 0;
  position: relative;
  background: var(--line);
}
.cal-week-days {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px;
}
.cal-day {
  min-height: calc(34px + max(var(--lane-count), 1) * 32px + 10px);
  background: var(--surface); padding: 6px; display: flex; flex-direction: column; gap: 4px;
}
.cal-day.outside { background: #FAFBFC; }
.cal-day.outside .cal-day-num { color: #AEB4BE; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--blue); }
.cal-day.drop { background: #EAF2FF; }
.cal-day--create { cursor: cell; }
.cal-day-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.cal-day-num { font-size: 12px; font-weight: 700; color: var(--ink); }
.cal-day-add {
  width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
  font: 700 14px/1 var(--font); color: var(--blue); background: #EAF2FF; text-decoration: none;
  position: relative; z-index: 2;
}
.cal-day-add:hover { background: var(--blue); color: #fff; }
.cal-week-bars {
  position: absolute; left: 0; right: 0; top: 30px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(var(--lane-count), 28px);
  gap: 4px 1px;
  padding: 0 4px;
  pointer-events: none;
  z-index: 1;
}
.cal-create-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-bottom: 20px;
}
.cal-create-grid label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink); }
.cal-create-grid .span-2 { grid-column: 1 / -1; }
.cal-create-grid .err, .cal-create .err { color: #C62828; font-weight: 500; font-size: 12px; }
.cal-create-grid select, .cal-create-grid input, .cal-create-grid textarea,
.cal-points-table input, .cal-points-table select {
  width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; font: 500 13px var(--font); background: var(--surface);
}
.cal-create-coords {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px;
}
.cal-create-geo {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
}
.cal-create-geo .geo-pick { width: 100%; margin-top: 0; }
.cal-create-geo .geo-pick-map { max-width: none; }
.cal-points-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cal-points-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cal-create .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.cal-points-table { width: max-content; min-width: 100%; margin-top: 8px; table-layout: auto; }
.cal-points-table th { font-size: 12px; text-align: left; color: var(--muted); font-weight: 600; padding: 6px 4px; white-space: nowrap; }
.cal-points-table td { padding: 4px; vertical-align: middle; }
.cal-points-table td:first-child { width: 28px; color: var(--muted); font-size: 12px; }
.cal-points-table input, .cal-points-table select { min-width: 0; max-width: 140px; }
.cal-points-table td:nth-child(3) input,
.cal-points-table td:nth-child(4) input { max-width: 180px; }
.cal-create-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .cal-create-grid { grid-template-columns: 1fr; }
  .cal-create-coords { grid-template-columns: 1fr; }
}
.cal-order {
  display: flex; align-items: center; gap: 6px; min-width: 0; position: relative;
  padding: 3px 8px; margin: 0 2px; border-radius: 6px; background: var(--surface); color: var(--ink);
  text-decoration: none; font-size: 11px; line-height: 1.2; border: 1px solid var(--line);
  cursor: grab; border-left: 3px solid #CFD5DE; pointer-events: auto;
  overflow: hidden; white-space: nowrap;
}
.cal-order:hover { background: #F7F8FA; }
.cal-order.dragging { opacity: .45; }
.cal-order.resizing { opacity: .92; z-index: 3; cursor: ew-resize; box-shadow: 0 0 0 2px rgba(37, 99, 235, .35); }
.cal-order b { font-size: 11px; flex: 0 0 auto; }
.cal-order > span:not(.cal-order-resize) {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2);
}
.cal-order-resize {
  position: absolute; top: 0; bottom: 0; width: 10px; z-index: 2;
  cursor: ew-resize; touch-action: none;
}
.cal-order-resize--start { left: 0; }
.cal-order-resize--end { right: 0; }
.cal-order-resize::after {
  content: ""; position: absolute; top: 20%; bottom: 20%; width: 3px; border-radius: 2px;
  background: color-mix(in srgb, var(--brigade-color, #64748B) 55%, var(--surface));
  opacity: 0; transition: opacity .12s;
}
.cal-order-resize--start::after { left: 2px; }
.cal-order-resize--end::after { right: 2px; }
.cal-order:hover .cal-order-resize::after,
.cal-order.resizing .cal-order-resize::after { opacity: 1; }
.cal-day.resize-hl {
  background: color-mix(in srgb, #2563EB 10%, transparent);
}
.cal-order--span { box-shadow: 0 1px 0 rgba(15, 23, 42, .04); }
.cal-order--cont-left { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.cal-order--cont-right { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
/* Цвет бригады: мягкая заливка + акцент слева */
.cal-order--colored {
  background: color-mix(in srgb, var(--brigade-color) 18%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brigade-color) 40%, var(--surface));
  border-left: 3px solid var(--brigade-color);
}
.cal-order--colored:hover {
  background: color-mix(in srgb, var(--brigade-color) 28%, var(--surface));
}
/* Дополнительный выезд по наряду: переносится в карточке наряда, не перетаскиванием */
.cal-order--interval { border-style: dashed; cursor: pointer; }
.cal-legend {
  display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 12px;
  font-size: 12px; color: var(--ink-2);
}
.cal-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend-swatch {
  width: 12px; height: 12px; border-radius: 3px; display: inline-block;
  background: var(--brigade-color); border: 1px solid color-mix(in srgb, var(--brigade-color) 50%, #666);
}
@media (max-width: 900px) {
  .cal-day { min-height: calc(30px + max(var(--lane-count), 1) * 28px + 8px); }
  .cal-order > span:not(.cal-order-resize) { display: none; }
}

/* Просмотр фото поверх страницы */
.pv-open-page { overflow: hidden; }
.pv {
  position: fixed; inset: 0; z-index: 2000; background: rgba(12, 16, 24, .92);
  display: flex; align-items: center; justify-content: center; user-select: none;
}
.pv[hidden] { display: none; }
.pv-top {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; color: #fff; font-size: 14px; background: linear-gradient(rgba(0,0,0,.55), transparent);
}
.pv-count { opacity: .75; white-space: nowrap; }
.pv-caption { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-btn, .pv-nav {
  border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
}
.pv-btn { width: 38px; height: 38px; font-size: 18px; }
.pv-btn:hover, .pv-nav:hover { background: rgba(255,255,255,.25); color: #fff; }
.pv a.pv-btn:link, .pv a.pv-btn:visited { color: #fff; }
.pv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 34px; z-index: 1; }
.pv-prev { left: 14px; }
.pv-next { right: 14px; }
.pv-single .pv-nav { display: none; }
.pv-stage {
  width: 100%; height: 100%; padding: 60px 80px 24px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
}
.pv-stage img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; box-shadow: 0 6px 30px rgba(0,0,0,.5); }
.pv-zoomed .pv-stage { overflow: auto; display: block; text-align: center; }
.pv-zoomed .pv-stage img { max-width: none; max-height: none; cursor: zoom-out; }
@media (max-width: 700px) {
  .pv-stage { padding: 56px 8px 8px; }
  .pv-nav { width: 40px; height: 40px; font-size: 26px; background: rgba(0,0,0,.35); }
  .pv-prev { left: 6px; }
  .pv-next { right: 6px; }
}

/* Строка наряда, из карточки которого вернулись в реестр */
#result_list tbody tr.row-returned td, #result_list tbody tr.row-returned th { box-shadow: inset 0 0 0 9999px rgba(255, 193, 7, .18); }
#result_list tbody tr.row-returned td:first-child, #result_list tbody tr.row-returned th:first-child { box-shadow: inset 3px 0 0 #F9A825, inset 0 0 0 9999px rgba(255, 193, 7, .18); }

/* Выбор точки на карте в карточке наряда СНТ */
.geo-pick { margin-top: 8px; width: 100%; }
.geo-pick-toggle { margin: 0; }
.geo-pick-panel { margin-top: 8px; }
.geo-pick-panel .help { margin: 0 0 6px; }
.geo-pick-map {
  height: 320px; width: 100%; max-width: 720px; border-radius: var(--radius);
  border: 1px solid var(--line-2); z-index: 0;
}
/* Ещё бригады в форме наряда из календаря — чекбоксы в строку */
.cal-create-brigades { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink); }
.cal-create-brigades > div, .cal-create-brigades ul {
  display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; padding: 0; margin: 2px 0;
}
.cal-create-brigades > div { border: 0; border-radius: 0; background: none; width: auto; height: auto; min-height: 0; }
.cal-create-brigades > div > div { display: contents; }
.cal-create-grid .cal-create-brigades label, .cal-create-grid label.cal-check {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap;
}
.cal-create-grid input[type="checkbox"] {
  width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; flex: none;
  border: 1.5px solid #B9BDC5; border-radius: 4px;
}
.cal-checks { display: grid; gap: 8px; align-content: center; }
.cal-create-grid input[type="checkbox"]:hover { border-color: var(--blue); }

/* Наряды без координат в списках */
#result_list tbody tr.row-no-coords td, #result_list tbody tr.row-no-coords th { background: #fdecea; }
#result_list tbody tr.row-no-coords td:first-child, #result_list tbody tr.row-no-coords th:first-child { box-shadow: inset 3px 0 0 #d93025; }

/* ---------- Карточки редактирования (за основу — карточка наряда): сводка, две колонки, цветные разделы ---------- */
html:has(body.change-form, body.card-page), body:is(.change-form, .card-page), body:is(.change-form, .card-page) .page-head { background: var(--page-bg-2); }
body.change-form .submit-row { background: rgba(243, 246, 250, .94); border-top-color: #DDE3EC; }
.change-form.order-card #content-main, .change-form.order-card #content { max-width: 1440px; }

.order-summary {
  display: grid; gap: 14px; margin: 0 0 16px; padding: 16px 20px;
  border-radius: 14px; color: #fff;
  background: linear-gradient(120deg, var(--navy) 0%, var(--blue) 62%, var(--teal) 100%);
  box-shadow: 0 6px 18px rgba(29, 58, 143, .16);
}
.order-summary-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.order-summary .badge { background: var(--surface); }
.order-summary-kind { font-size: 15px; font-weight: 700; }
.order-summary-project { font-size: 13px; opacity: .8; }
.order-summary-snt {
  padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: rgba(255, 255, 255, .18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}
.snt-create { flex-basis: 100%; margin-top: 6px; }
.snt-create-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.snt-create-form input { flex: 1 1 260px; min-width: 0; }
.snt-create-form[hidden] { display: none; }
.snt-create-status { margin-top: 4px; font-size: 13px; }
.snt-create-status.ok { color: var(--green); }
.snt-create-status.err { color: #d93025; }
.order-summary-facts { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 12px 24px; margin: 0; }
.order-summary-facts dt { margin: 0 0 2px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .72; }
.order-summary-facts dd { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.order-summary-facts a { color: #fff; text-decoration: underline dotted rgba(255, 255, 255, .6); text-underline-offset: 3px; }
.order-summary-facts .is-empty dd { color: #FFD59E; }

.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 16px; align-items: start; }
.order-main, .order-side { min-width: 0; }
.form-sec {
  margin: 0 0 16px; border-radius: var(--radius); background: var(--surface); overflow: hidden;
}
.form-sec > h2 { margin: 0; padding: 10px 18px; color: var(--ink); font-weight: 700; }
.form-sec > .cal-create-grid, .form-sec > .form-sec-body { margin: 0; padding: 14px 18px 16px; }
.cal-create-grid--one { grid-template-columns: minmax(0, 1fr); }
.cal-field { display: grid; gap: 4px; }
.card-page .cal-create-foot { position: sticky; bottom: 0; z-index: 5; padding: 12px 0; margin: 0;
  background: rgba(243, 246, 250, .94); border-top: 1px solid #DDE3EC; }

body.change-form fieldset.module, body.change-form .inline-group .module, .form-sec {
  --sec: var(--blue);
  border: 1px solid #E1E6EE; border-top: 3px solid var(--sec);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .05);
}
body.change-form fieldset.module > h2, body.change-form .inline-group h2, .form-sec > h2 {
  display: flex; align-items: center; gap: 10px;
  background: color-mix(in srgb, var(--sec) 7%, var(--surface));
  border-bottom: 1px solid color-mix(in srgb, var(--sec) 16%, var(--surface));
  font-size: 14px;
}
body.change-form fieldset.module > h2::before, body.change-form .inline-group h2::before, .form-sec > h2::before {
  content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--sec); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sec) 22%, var(--surface));
}
body :is(fieldset.module, .form-sec).sec-pnr { --sec: var(--cyan); }
body :is(fieldset.module, .form-sec).sec-object { --sec: var(--teal); }
body :is(fieldset.module, .form-sec).sec-meter { --sec: var(--orange); }
body :is(fieldset.module, .form-sec).sec-extra { --sec: #7A5AF8; }
body :is(fieldset.module, .form-sec).sec-docs { --sec: var(--navy); }
body :is(fieldset.module, .form-sec).sec-people { --sec: var(--green); }
body :is(fieldset.module, .form-sec).sec-status { --sec: #5F6B7A; }
body :is(fieldset.module, .form-sec).sec-link { --sec: var(--cyan); }
body.change-form .inline-group .module { --sec: #8A94A6; }
body.change-form #install_points-group .module, body.change-form #works-group .module, .form-sec.sec-points { --sec: var(--orange); }
body.change-form #photos-group .module { --sec: var(--teal); }

body.change-form .form-row { padding: 10px 18px; border-bottom-color: #F0F2F6; }
body.change-form fieldset.module .description {
  margin: 12px 18px 2px; padding: 8px 12px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--sec) 6%, var(--surface)); color: var(--ink-2);
}
body.change-form .aligned label, body.change-form .form-multiline > div:first-child label { width: 190px; flex: none; }
body.change-form .aligned .checkbox-row label { width: auto; flex: 0 1 auto; }
body.change-form .aligned .help { margin-left: 202px; }
body.change-form .aligned textarea { width: min(680px, 100%); }
body.change-form form .aligned div.readonly { color: var(--body-loud-color); }
.order-main div.form-row.field-visit_from > .form-multiline { flex-wrap: wrap; row-gap: 8px; }
/* Пары полей (город и улица, дом и квартира, широта и долгота) — в одну строку */
.order-main .form-row:not(.field-visit_from) > .form-multiline { flex-wrap: nowrap; gap: 16px; }
.order-main .form-row:not(.field-visit_from) > .form-multiline > div { flex: 1 1 0; min-width: 0; }
.order-main .form-row:not(.field-visit_from) > .form-multiline > div + div label { width: auto; min-width: 72px; white-space: nowrap; }
.order-main .form-row:not(.field-visit_from) > .form-multiline .fieldBox { width: 100%; margin-right: 0; }
.order-main .form-row:not(.field-visit_from) > .form-multiline input:not([type=checkbox]) { width: 100%; min-width: 0; }

/* Правая колонка узкая: подпись над полем */
.order-side .aligned .form-row > div > .flex-container:not(.checkbox-row) { flex-direction: column; align-items: stretch; }
.order-side form .aligned label, .order-side .aligned label { width: auto; padding: 0 0 4px; }
.order-side form .aligned div.help, .order-side .help { margin-left: 0; }
.order-side form .aligned div.readonly { padding-top: 0; }
.order-side select, .order-side input[type=text], .order-side input[type=url], .order-side textarea, .order-side .vTextField { width: 100%; max-width: 100%; }
.order-side .related-widget-wrapper { display: flex; width: 100%; }
.order-side .related-widget-wrapper select { flex: 1; min-width: 0; }
.order-side .selector { width: 100%; }

@media (max-width: 1180px) {
  .order-layout { grid-template-columns: minmax(0, 1fr); }
  .order-summary-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .order-summary-facts { grid-template-columns: minmax(0, 1fr); }
  body.change-form .aligned .help { margin-left: 0; }
}

/* Проверка ТП: таблица приборов участков */
.tp-waviot { display: grid; gap: 4px; justify-items: start; min-width: 110px; }
.tp-waviot .button { height: 30px; padding: 0 12px; line-height: 28px; }
.tp-waviot { min-width: 170px; max-width: 260px; }
.tp-waviot .tp-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.tp-waviot .tp-actions .button { height: 28px; line-height: 26px; padding: 0 10px; font-size: 12px; }
.tp-waviot .tp-result { display: grid; gap: 2px; }
.tp-passport { display: inline-block; margin: 0 4px 4px 0; }
.tp-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 12px; }
.tp-passport img { height: 64px; width: auto; border-radius: 6px; border: 1px solid #d7e3f4; }
.change-form.model-tpcheckorder #content-main, .change-form.model-tpcheckorder #content { max-width: min(1680px, calc(100vw - 48px)); }
.model-tpcheckorder .inline-group .tabular { overflow-x: auto; }
.model-tpcheckorder .inline-group .tabular td { vertical-align: middle; }
body.model-tpcheckorder #install_points-group .tabular thead th { white-space: normal; max-width: 96px; line-height: 1.3; vertical-align: bottom; }
body.model-tpcheckorder #install_points-group .tabular td.field-tp_comment input { width: 180px; }
body.model-tpcheckorder #install_points-group .tabular td { white-space: normal; }
body.model-tpcheckorder #install_points-group .tabular td.field-tp_checked { min-width: 120px; }
body.model-tpcheckorder fieldset.module .form-multiline { gap: 8px 32px; }
body.model-tpcheckorder fieldset.module .form-row label { width: auto; min-width: 0; padding-right: 8px; }
.model-tpcheckorder .inline-group .tabular td.original p { display: none; }
body.model-tpcheckorder #install_points-group .tabular :is(th, td):is(.column-tp_waviot_added, .column-tp_signal_ok, .column-tp_tariff_set, .field-tp_waviot_added, .field-tp_signal_ok, .field-tp_tariff_set) { width: 96px; text-align: center; }
.tp-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 1000; display: grid; gap: 10px; width: min(360px, calc(100vw - 40px)); }
.tp-toast { background: var(--surface); border: 1px solid #d7e3f4; border-left: 4px solid #0b5cad; border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 42, 80, .18); padding: 12px 14px; display: grid; gap: 6px; animation: tp-toast-in .25s ease-out; }
.tp-toast-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; }
.tp-toast-close { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: #6b7a90; padding: 0 2px; }
.tp-toast-item { display: block; color: #0b5cad; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-toast-item:hover { text-decoration: underline; }
@keyframes tp-toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Дополнительные интервалы монтажа — вложенный блок в разделе «Наряд», под плановой датой и временем */
body.order-card fieldset.module .inline-group { margin: 0 18px 12px; }
body.order-card fieldset.module .inline-group .module { --sec: var(--blue); border-top-width: 1px; border-radius: 10px; box-shadow: none; }
body.order-card fieldset.module .inline-group h2 { padding: 8px 12px; font-size: 13px; }
body.order-card fieldset.module .inline-group .tabular td, body.order-card fieldset.module .inline-group .tabular thead th { padding: 6px 10px; }
body.order-card fieldset.module .inline-group div.add-row, body.order-card fieldset.module .inline-group .tabular tr.add-row td { padding: 8px 12px; }
@media (max-width: 860px) { body.order-card fieldset.module .inline-group { margin-left: 14px; margin-right: 14px; } }
body.order-card #intervals-group td.original p { display: none; }
body.order-card #intervals-group td { white-space: nowrap; }
body.order-card #intervals-group td select { width: 60px; padding: 0 6px; }
body.order-card #intervals-group td input[type=date] { width: 160px; }

/* Карточка СНТ в справочнике: широта и долгота рядом, под ними в одну линию «Подставить координаты»
   и «Указать на карте» (кнопки из geocode.js и geo_pick.js), карта — под кнопками */
.model-sntobject .form-row.field-lat { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.model-sntobject .form-row.field-lat > .form-multiline { flex: 0 0 100%; justify-content: flex-start; gap: 0 12px; }
.model-sntobject .form-row.field-lat > .form-multiline > div { flex: 0 0 auto; margin: 0; }
.model-sntobject .form-row.field-lat .fieldBox.field-lon { align-items: center; margin: 0; }
.model-sntobject .form-row.field-lat label[for=id_lon] { width: auto; min-width: 0; margin: 0; padding: 0 8px 0 0; }
.model-sntobject .form-row.field-lat > .geocode-status,
.model-sntobject .form-row.field-lat > .geo-pick { display: contents !important; }
.model-sntobject .form-row.field-lat .geocode-status > button,
.model-sntobject .form-row.field-lat .geo-pick-toggle { margin: 0; padding: 6px 14px !important; font-size: 13px; line-height: 1.3; }
.model-sntobject .form-row.field-lat .geocode-status > button { order: 1; margin-left: 190px; }
.model-sntobject .form-row.field-lat .geo-pick-toggle { order: 2; }
.model-sntobject .form-row.field-lat .geocode-status > span { order: 3; }
.model-sntobject .form-row.field-lat .geo-pick-panel { order: 4; flex: 0 0 calc(100% - 190px); margin: 4px 0 0 190px; }
.model-sntobject .form-row.field-lat .geo-pick-panel .help { margin-left: 0; padding-left: 0; }
@media (max-width: 767px) {
  .model-sntobject .form-row.field-lat .geocode-status > button { margin-left: 0; }
  .model-sntobject .form-row.field-lat .geo-pick-panel { flex-basis: 100%; margin-left: 0; }
}

/* Карта БС: маркер режима и фильтр «на связи» */
.bs-dash { display: flex; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.bs-dash-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 140px;
  padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  cursor: pointer; font: inherit; color: var(--ink); text-align: left;
}
.bs-dash-card b { font-size: 22px; line-height: 1.1; }
.bs-dash-card span { font-size: 12px; color: var(--muted); }
.bs-dash-card.is-on { border-color: var(--blue, #005BAA); box-shadow: inset 0 0 0 1px var(--blue, #005BAA); }
.bs-dash-card[data-bs-filter="online"] b { color: #2E8B3E; }
.bs-dash-card[data-bs-filter="offline"] b { color: #C62828; }
.bs-marker { background: none; border: 0; }
.bs-marker span {
  display: flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
[data-bs-modes] [data-mode="BS"] { background: #005BAA; }
[data-bs-modes] [data-mode="USPD"] { background: #2E8B3E; }
[data-bs-modes] [data-mode="GATEWAY"] { background: #7A4EAB; }
[data-bs-modes] [data-mode="OTHER"] { background: #5F6B7A; }
[data-bs-list] .map-person-row { flex-direction: column; align-items: stretch; gap: 2px; }
[data-bs-list] .map-person-row b { display: block; font-size: 13px; }
[data-bs-list] .map-person-row .muted { display: block; white-space: normal; }
.bs-map-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 12px; }
.bs-map-filters .status-chips { margin: 0; }
.bs-client-filter { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.bs-client-filter select { font: inherit; color: var(--ink); padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); max-width: 320px; }
.bs-table-wrap { margin-top: 16px; }
.bs-table-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 8px; flex-wrap: wrap; }
.bs-table-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; flex: 1; justify-content: flex-end; }
.bs-table-tools label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.bs-table-tools select { font: inherit; color: var(--ink); padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.bs-table-head input[type=search] { min-width: 220px; max-width: 420px; flex: 1; }
.bs-table-pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 8px; font-size: 13px; }
.bs-table-pager button:disabled { opacity: .45; cursor: default; }
.bs-table-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.bs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bs-table th, .bs-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.bs-table th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; padding: 0; }
.bs-table th [data-bs-sort] {
  display: inline-flex; align-items: center; gap: 6px; width: 100%;
  padding: 8px 10px; border: 0; background: none; font: inherit; color: inherit; text-align: left;
}
.bs-table th [data-bs-sort]::after {
  content: ""; flex: none; width: 10px; height: 14px; opacity: .4;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14'%3E%3Cpath d='M5 1 9 5H1zM5 13 1 9h8z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14'%3E%3Cpath d='M5 1 9 5H1zM5 13 1 9h8z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.bs-table th button.is-sorted { color: var(--blue, #005BAA); }
.bs-table th button.is-asc::after {
  opacity: 1;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14'%3E%3Cpath d='M5 1 9 5H1z'/%3E%3Cpath d='M5 13 1 9h8z' opacity='.25'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14'%3E%3Cpath d='M5 1 9 5H1z'/%3E%3Cpath d='M5 13 1 9h8z' opacity='.25'/%3E%3C/svg%3E");
}
.bs-table th button.is-desc::after {
  opacity: 1;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14'%3E%3Cpath d='M5 1 9 5H1z' opacity='.25'/%3E%3Cpath d='M5 13 1 9h8z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14'%3E%3Cpath d='M5 1 9 5H1z' opacity='.25'/%3E%3Cpath d='M5 13 1 9h8z'/%3E%3C/svg%3E");
}
.bs-table tbody tr { cursor: pointer; }
.bs-table td.bs-actions { text-align: center; vertical-align: middle; }
.bs-row-actions, .bs-popup-actions {
  display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
}
.bs-popup-actions { margin-top: 8px; }
.bs-row-actions .button, .bs-popup-actions .button {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  height: 30px; margin: 0; padding: 0 12px; line-height: 1; text-decoration: none; white-space: nowrap;
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--radius);
  font: 600 13px/1 var(--font);
}
.bs-row-actions .button:hover, .bs-popup-actions .button:hover {
  border-color: var(--blue); color: var(--blue); background: var(--hover);
}
.bs-cmd-card { margin: 12px 0 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.bs-cmd-dialog { position: fixed; inset: 0; background: rgba(20, 28, 38, .45); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.bs-cmd-dialog[hidden] { display: none; }
.bs-cmd-panel { width: min(480px, 100%); background: var(--surface); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.bs-cmd-panel label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.bs-cmd-panel select, .bs-cmd-panel textarea { font: inherit; width: 100%; }
.bs-cmd-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bs-cmd-result { margin: 0; white-space: pre-wrap; }

/* ---------- История опроса УСПД ---------- */
.uspd-poll-filters {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end;
  margin: 0 0 14px; padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px;
}
.uspd-poll-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.uspd-poll-filters input, .uspd-poll-filters select {
  font: 13px var(--font); padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; color: var(--ink);
}
.uspd-poll-check { flex-direction: row !important; align-items: center; gap: 8px !important; padding-bottom: 8px; }
.uspd-poll-filters select { max-width: 220px; }
/* Горизонтальная (и вертикальная) полоса прокрутки всегда в зоне экрана */
.uspd-poll-wrap {
  max-width: 100%;
  max-height: calc(100vh - 260px);
  min-height: 240px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  scrollbar-gutter: stable;
}
.uspd-poll-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.uspd-poll-table th, .uspd-poll-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle;
}
.uspd-poll-table thead th {
  position: sticky; top: 0; z-index: 2; background: #f8fafc; font-weight: 600; color: var(--muted);
}
.uspd-poll-table .sticky-col {
  position: sticky; left: 0; z-index: 1; background: var(--surface);
}
.uspd-poll-table thead .sticky-col { z-index: 3; background: #f8fafc; }
.uspd-poll-table .day-col { text-align: center; min-width: 52px; }
.uspd-poll-table .uspd-poll-sort { color: inherit; white-space: nowrap; }
.table-column-heading {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; vertical-align: middle;
}
.table-column-heading-title { min-width: 0; }
.table-column-filter {
  display: inline-grid; place-items: center; vertical-align: middle;
  flex: none; width: 26px; height: 26px; padding: 0;
}
.table-column-filter::before { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
.table-column-filter.is-filtered {
  background: var(--hover); border-color: var(--blue); color: var(--ink);
}
.table-column-menu {
  position: fixed; inset: auto; margin: 0; padding: 12px;
  width: min(320px, calc(100vw - 16px)); box-sizing: border-box;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
#table-column-title { font-weight: 600; margin-bottom: 8px; }
.table-column-menu input[type="search"] { width: 100%; box-sizing: border-box; margin-bottom: 8px; }
.table-column-values { max-height: min(220px, 30vh); overflow: auto; }
.table-column-option { display: flex; align-items: flex-start; gap: 8px; padding: 4px; overflow-wrap: anywhere; }
.table-column-option:hover { background: var(--hover); }
.table-column-menu .submit-row { display: flex; justify-content: flex-end; gap: 8px; margin: 8px 0 0; padding: 8px 0 0; }
.table-clear-filters { margin-bottom: 8px; }
.table-filtered-out { display: none !important; }
.table-filtering .actions :is(.question, .all, .clear, .action-counter) { display: none !important; }
.uspd-poll-sort span { color: var(--muted); }
.uspd-poll-table [aria-sort] .uspd-poll-sort span { color: inherit; }
.uspd-poll-table .num { text-align: center; font-variant-numeric: tabular-nums; }
.uspd-poll-table .pct { text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.uspd-poll-table .pct-ok { background: #ecfdf5; color: #047857; }
.uspd-poll-table .pct-warn { background: #fffbeb; color: #b45309; }
.uspd-poll-table .pct-bad { background: #fef2f2; color: #b91c1c; }
.uspd-poll-table tr.is-off td { opacity: .55; }
.uspd-poll-table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.uspd-poll-table .uspd-addr {
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.uspd-poll-table .pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.uspd-poll-table .pill.ok { background: #ecfdf5; color: #047857; }
.uspd-poll-table .pill.bad { background: #fef2f2; color: #b91c1c; }

/* ---------- Тёмная тема (переключатель в меню; выбор хранится в браузере) ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --blue: #2F7BFF;
  --blue-dark: #1F63E0;
  --cyan: #22C3F3;
  --teal: #4FB8F0;
  --green: #2ED47A;
  --orange: #FF9A3D;
  --red: #FF5A5F;

  --ink: #E6EBF4;
  --ink-2: #B4BED0;
  --muted: #7F8BA3;
  --line: #1E2C47;
  --line-2: #2A3A5A;
  --side-bg: #0A1426;
  --hover: #15233F;
  --sel: #16305C;
  --row-sel: #132A50;
  --surface: #0F1B31;
  --surface-2: #13223D;
  --page-bg: #091223;
  --page-bg-2: #091223;
  --track: #1B2944;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);

  --body-loud-color: #F4F7FC;
  --link-fg: var(--teal);
  --link-hover-color: #8FD3FF;
  --message-success-bg: #10301F;
  --message-warning-bg: #33240F;
  --message-error-bg: #3A1418;
  --close-button-bg: #3A4866;
  --close-button-hover-bg: #4A5A7C;
  --object-tools-hover-bg: var(--hover);
  --header-bg: var(--side-bg);
  --selected-bg: var(--sel);
  --selected-row: var(--row-sel);
}
html[data-theme="dark"] body { background: radial-gradient(1200px 600px at 70% -10%, #11244A 0, transparent 60%), var(--page-bg); background-attachment: fixed; }
html[data-theme="dark"] .side {
  background: linear-gradient(180deg, #0B1730 0%, #091224 100%);
  border-right-color: #15223B;
}
html[data-theme="dark"] .side-brand .logo-full, html[data-theme="dark"] .login-logo { filter: brightness(0) invert(1); opacity: .95; }
html[data-theme="dark"] .nav-item .i { color: #6F7C96; }
html[data-theme="dark"] .nav-item:hover, html[data-theme="dark"] .nav-item:focus { background: #13213B; color: #fff; }
html[data-theme="dark"] .nav-item.active {
  margin: 2px 10px; width: calc(100% - 20px); padding: 0 10px; border-radius: 10px;
  background: linear-gradient(90deg, #1F5FE0, #2C7BFF 70%, #3A8BFF);
  box-shadow: 0 6px 18px rgba(47, 123, 255, .35); color: #fff;
}
html[data-theme="dark"] .side a.nav-item.active:link, html[data-theme="dark"] .side a.nav-item.active:visited { color: #fff; }
html[data-theme="dark"] .nav-item.active .i { color: #fff; }
html[data-theme="dark"] .nav-item.active::before { display: none; }
html[data-theme="dark"] .side-collapsed .nav-item.active { margin: 2px 8px; width: calc(100% - 16px); padding: 0; }
html[data-theme="dark"] .card, html[data-theme="dark"] .kpi, html[data-theme="dark"] .map-panel,
html[data-theme="dark"] .tile, html[data-theme="dark"] .bs-table-scroll {
  background: linear-gradient(180deg, #111F38 0%, #0E1A30 100%);
  border-color: #1C2A46; box-shadow: var(--shadow);
}
html[data-theme="dark"] .tile:hover { border-color: #2C4A80; box-shadow: 0 10px 30px rgba(47, 123, 255, .18); }
html[data-theme="dark"] .filter-bar { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .dash-tabs { background: var(--surface); }
html[data-theme="dark"] .dash-tab:hover { background: var(--hover); color: #fff; }
html[data-theme="dark"] .dash-tab.active { background: linear-gradient(90deg, #1F5FE0, #2C7BFF); color: #fff; box-shadow: 0 4px 14px rgba(47, 123, 255, .3); }
html[data-theme="dark"] a.dash-tab.active:link, html[data-theme="dark"] a.dash-tab.active:visited { color: #fff; }
html[data-theme="dark"] .kpi-icon.blue { background: rgba(47, 123, 255, .16); color: #6FA4FF; }
html[data-theme="dark"] .kpi-icon.cyan { background: rgba(34, 195, 243, .14); color: #5BD3F7; }
html[data-theme="dark"] .kpi-icon.navy { background: rgba(139, 108, 255, .16); color: #A894FF; }
html[data-theme="dark"] .kpi-icon.orange { background: rgba(255, 154, 61, .15); color: #FFB16B; }
html[data-theme="dark"] .kpi-icon.green { background: rgba(46, 212, 122, .14); color: #5BE39A; }
html[data-theme="dark"] .kpi-icon.red { background: rgba(255, 90, 95, .15); color: #FF8589; }
html[data-theme="dark"] .badge, html[data-theme="dark"] .badge-gray { background: #1A2742; color: var(--ink-2); }
html[data-theme="dark"] .badge-cyan { background: rgba(34, 195, 243, .14); color: #5BD3F7; }
html[data-theme="dark"] .badge-green { background: rgba(46, 212, 122, .14); color: #5BE39A; }
html[data-theme="dark"] .badge-darkgreen { background: rgba(46, 212, 122, .2); color: #7BEAAE; }
html[data-theme="dark"] .badge-orange { background: rgba(255, 154, 61, .15); color: #FFB16B; }
html[data-theme="dark"] .badge-red { background: rgba(255, 90, 95, .15); color: #FF8589; }
html[data-theme="dark"] #changelist .actions { border-color: #24427A; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea {
  background-color: #0C172B; color: var(--ink); border-color: var(--line-2);
}
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #5D6A84; }
html[data-theme="dark"] .leaflet-container { background: #0C172B; }
html[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(195deg) brightness(.9) contrast(.9) saturate(.6); }
html[data-theme="dark"] .leaflet-popup-content-wrapper, html[data-theme="dark"] .leaflet-popup-tip { background: var(--surface-2); color: var(--ink); }
html[data-theme="dark"] .sw-unknown, html[data-theme="dark"] .seg-unknown { background: #46546F; }
html[data-theme="dark"] .stack .seg-unknown { color: #E6EBF4; }
html[data-theme="dark"] .hb-bar.hb-gray { background: #46546F; }
html[data-theme="dark"] .bar-plan, html[data-theme="dark"] .sw-plan { background: #2A3B5E; }
html[data-theme="dark"] .login-form, html[data-theme="dark"] body.login { background: var(--page-bg); }

.theme-toggle .i-sun { display: none; }
html[data-theme="dark"] .theme-toggle .i-sun { display: inline-block; }
html[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* ---------- Графики (Chart.js) ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 12px; margin-bottom: 12px; }
.dash-grid > .card { margin: 0; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 280px; }
.chart-box canvas { position: relative; z-index: 1; }
.chart-box.loading::before {
  content: ""; position: absolute; inset: 8px 0 18px; border-radius: 10px;
  background: linear-gradient(90deg, var(--track) 0, var(--surface-2) 40%, var(--track) 80%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
.donut-wrap { display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 16px; }
.donut-box { position: relative; height: 170px; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center b { font-size: 26px; font-weight: 800; color: var(--body-loud-color); line-height: 1; font-variant-numeric: tabular-nums; }
.donut-center small { font-size: 11px; color: var(--muted); }
.donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.donut-legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.donut-legend li b { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.donut-legend i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
@media (max-width: 520px) { .donut-wrap { grid-template-columns: 1fr; } }
.kpi-spark { height: 44px; margin: 2px -4px 0; }
.kpi-spark canvas { width: 100% !important; }
.chart-empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13px; }

/* ---------- Динамика: появление блоков, полоса загрузки, переходы страниц ---------- */
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }

.cabinet-page .kpis > .kpi, .cabinet-page [data-live] > .card, .cabinet-page .dash-grid > .card,
.cabinet-page .cards-2 > .card, .tiles > .tile {
  animation: rise .45s cubic-bezier(.2, .7, .2, 1) backwards;
}
.kpis > .kpi:nth-child(2), .tiles > .tile:nth-child(2) { animation-delay: .05s; }
.kpis > .kpi:nth-child(3), .tiles > .tile:nth-child(3) { animation-delay: .1s; }
.kpis > .kpi:nth-child(4), .tiles > .tile:nth-child(4) { animation-delay: .15s; }
.tiles > .tile:nth-child(n+5) { animation-delay: .2s; }
.cabinet-page [data-live] > .card, .cabinet-page .dash-grid > .card, .cabinet-page .cards-2 > .card { animation-delay: .12s; }
[data-live].calm, [data-live].calm * { animation: none !important; }
.progress > span, .hb-bar, .stack { transform-origin: left center; animation: grow-x .8s cubic-bezier(.2, .7, .2, 1) backwards .15s; }
/* Только opacity и без fill forwards: transform у #content сделал бы его опорой для position: fixed (панель фильтров, просмотр фото) */
#content { animation: page-in .3s ease-out backwards; }

.page-progress {
  position: fixed; inset: 0 0 auto 0; z-index: 2000; height: 3px; pointer-events: none;
  transform: scaleX(0); transform-origin: left; opacity: 0;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  box-shadow: 0 0 10px var(--cyan);
}
.page-progress.run { opacity: 1; animation: progress-run 8s cubic-bezier(.1, .7, .2, 1) forwards; }
.page-progress.done { opacity: 0; transform: scaleX(1); transition: opacity .3s ease .1s, transform .2s ease; }
@keyframes progress-run { 0% { transform: scaleX(0); } 20% { transform: scaleX(.45); } 100% { transform: scaleX(.92); } }
.live-busy #content { opacity: .55; transition: opacity .2s ease; pointer-events: none; }

@view-transition { navigation: auto; }
.side { view-transition-name: side; }
::view-transition-old(root) { animation: .18s ease-in both vt-out; }
::view-transition-new(root) { animation: .28s cubic-bezier(.2, .7, .2, 1) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) {
    animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important;
  }
}

/* Цвета легенд — те же, что у графиков */
.sw-blue { background: #005BAA; } .sw-cyan { background: #14B1E7; } .sw-green { background: #2E9E44; }
.sw-purple { background: #5B4BC4; } .sw-orange { background: #EA8917; } .sw-red { background: #C62828; } .sw-gray { background: #C9CED6; }
html[data-theme="dark"] .sw-blue, html[data-theme="dark"] .sw-fact, html[data-theme="dark"] .bar-fact { background: #2F7BFF; }
html[data-theme="dark"] .sw-cyan { background: #22C3F3; }
html[data-theme="dark"] .sw-green, html[data-theme="dark"] .sw-online, html[data-theme="dark"] .seg-online, html[data-theme="dark"] .bar-online,
html[data-theme="dark"] .hb-in { background: #2ED47A; }
html[data-theme="dark"] .sw-purple { background: #8B6CFF; } html[data-theme="dark"] .sw-orange { background: #FF9A3D; }
html[data-theme="dark"] .sw-red, html[data-theme="dark"] .sw-silent, html[data-theme="dark"] .seg-silent { background: #FF5A5F; }
html[data-theme="dark"] .sw-gray { background: #46546F; }
html[data-theme="dark"] .progress > span { background: linear-gradient(90deg, #1F5FE0, #22C3F3); box-shadow: 0 0 12px rgba(34, 195, 243, .35); }
html[data-theme="dark"] .progress.green > span { background: linear-gradient(90deg, #1FAE63, #2ED47A); box-shadow: 0 0 12px rgba(46, 212, 122, .3); }
html[data-theme="dark"] .progress.orange > span { background: linear-gradient(90deg, #E0761F, #FFB16B); }
html[data-theme="dark"] .hb-bar { background: linear-gradient(90deg, #1F5FE0, #2F7BFF); }
html[data-theme="dark"] .hb-bar.hb-old { background: linear-gradient(90deg, #C23B40, #FF5A5F); }
html[data-theme="dark"] .kpi-table tr, html[data-theme="dark"] .hbars tr, html[data-theme="dark"] .plain-table tr,
html[data-theme="dark"] .kpi-table td, html[data-theme="dark"] .hbars td, html[data-theme="dark"] .plain-table td { background: transparent; }
html[data-theme="dark"] .nav-item:hover { background: #13213B; }
html[data-theme="dark"] .submit-row, html[data-theme="dark"] body.change-form .submit-row,
html[data-theme="dark"] .card-page .cal-create-foot { background: rgba(9, 18, 35, .92); border-top-color: var(--line); backdrop-filter: blur(8px); }
html[data-theme="dark"] #result_list tbody tr.row-no-coords td, html[data-theme="dark"] #result_list tbody tr.row-no-coords th { background: rgba(255, 90, 95, .1); }
html[data-theme="dark"] .cal-day.drop, html[data-theme="dark"] .cal-day-add { background: #16305C; color: #8FB8FF; }
html[data-theme="dark"] .uspd-poll-table th,
html[data-theme="dark"] .uspd-poll-table thead .sticky-col { background: var(--surface-2); }
html[data-theme="dark"] .uspd-poll-table .pct-ok, html[data-theme="dark"] .uspd-poll-table .pill.ok { background: rgba(46, 212, 122, .14); color: #5BE39A; }
html[data-theme="dark"] .uspd-poll-table .pct-bad, html[data-theme="dark"] .uspd-poll-table .pill.bad { background: rgba(255, 90, 95, .15); color: #FF8589; }
html[data-theme="dark"] .uspd-poll-table .pct-warn { background: rgba(255, 154, 61, .15); color: #FFB16B; }

html[data-theme="dark"] .nav-group { color: #AEB9CE; }
html[data-theme="dark"] .nav-group .i { color: #6F7C96; }
html[data-theme="dark"] .nav-group:hover { background: #13213B; color: #fff; }
html[data-theme="dark"] .nav-sect.open > .nav-group { color: #fff; }
html[data-theme="dark"] .nav-sect.open > .nav-sub { background: rgba(255, 255, 255, .025); }
html[data-theme="dark"] .nav-count { background: #16243F; color: #8D99B0; }
html[data-theme="dark"] .nav-sub .nav-item.active { padding-left: 22px; }
html[data-theme="dark"] .side-collapsed .nav-sub .nav-item.active { padding-left: 0; }
