/* Переменные */
:root {
  --color-bg: #f4f6f8;
  --color-panel: #ffffff;
  --color-border: #d3d8dd;
  --color-border-strong: #bdc8d8;
  --color-text: #1d1d1b;
  --color-muted: #797979;
  --color-primary: #1c3e83;
  --color-accent: #fab400;
  --color-danger: #a32929;
  --color-table-border: #d7dde5;
  --color-table-head-bg: #e9f0f8;
  --color-table-head-text: #17356e;
  --color-table-head-border: #9fb0c6;
  --color-table-hover: #dcecff;
  --color-selection-table-hover: #d8eaff;
  --color-recommendation-row: #e2f7e8;
  --color-recommendation-best: #bfeacb;
  --color-recommendation-low: #d6f1bd;
  --color-recommendation-medium: #ffe48a;
  --color-recommendation-high: #ffc4b8;
  --radius-control: 4px;
  --radius-panel: 6px;
  --shadow-tooltip: 0 8px 18px rgba(29, 29, 27, 0.14);
  --shadow-modal: 0 22px 48px rgba(29, 29, 27, 0.2);
  --layout-max-width: 1840px;
}

/* База */
* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  height: 100%;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

a {
  color: var(--color-primary);
}

/* Каркас страницы */
.page-header {
  flex: 0 0 auto;
  background: var(--color-panel);
  border-bottom: 1px solid var(--color-border);
}

.page-header__inner,
.page-main {
  width: min(var(--layout-max-width), calc(100% - 32px));
  margin: 0 auto;
}

.page-header__inner {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  color: var(--color-text);
}

.brand__logo-link {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
}

.brand__logo {
  display: block;
  width: 196px;
  height: auto;
  max-height: 68px;
  object-fit: contain;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand__organization {
  overflow: hidden;
  color: var(--color-primary);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand__title {
  overflow: hidden;
  color: #40536b;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: normal;
}

.control-panel {
  display: flex;
  align-items: center;
  max-width: 100%;
  gap: 14px;
  flex-wrap: wrap;
}

.control-panel__body {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.control-panel__group,
.control-panel__session {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.control-panel__session {
  margin-left: 4px;
  padding-left: 18px;
  border-left: 2px solid #c7d0dc;
}

.control-panel__session-tools,
.control-panel__logout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.control-panel__logout {
  margin-left: 6px;
  padding-left: 14px;
  border-left: 1px solid #d8e0ea;
}

.logout-form {
  display: inline-flex;
  margin: 0;
}

.supplier-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 2px;
  border: 1px solid #c7d4e4;
  border-radius: 6px;
  background: #f7faff;
}

.supplier-mode-switch__label {
  padding: 0 6px 0 5px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.page-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 0;
}

.page-footer {
  flex: 0 0 auto;
  position: relative;
  width: min(var(--layout-max-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 4px 0 14px;
  text-align: center;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1;
}

.page-footer__links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  opacity: 0.7;
}

.page-footer__copyright,
.page-footer__policy {
  display: inline-block;
}

.page-footer__copyright a,
.page-footer__policy {
  color: inherit;
  text-decoration: none;
}

.page-footer__copyright a:hover,
.page-footer__copyright a:focus-visible,
.page-footer__policy:hover,
.page-footer__policy:focus-visible {
  color: var(--color-primary);
}

.developer-link {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-muted);
  font-size: 11px;
  line-height: 1;
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.developer-link:hover,
.developer-link:focus-visible {
  color: var(--color-primary);
  opacity: 1;
}

.developer-link__logo {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
  transform-origin: center;
  transition: transform 0.16s ease;
}

.developer-link:hover .developer-link__logo,
.developer-link:focus-visible .developer-link__logo {
  transform: none;
}

/* Панели и сетки */
.panel {
  flex: 0 0 auto;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  padding: 24px;
}

.panel--compact {
  padding: 14px 16px;
}

.panel--primary {
  border-top: 5px solid var(--color-primary);
}

.panel + .panel {
  margin-top: 20px;
}

.panel--narrow {
  max-width: 760px;
}

.panel h1,
.panel h2 {
  margin: 0 0 18px;
}

.panel--compact h1,
.panel--compact h2 {
  margin-bottom: 10px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric {
  border-left: 4px solid var(--color-accent);
  padding: 8px 0 8px 14px;
}

.metric__label {
  color: var(--color-muted);
  font-size: 13px;
}

.metric__value {
  font-size: 22px;
  font-weight: 700;
}

.metric__value--small {
  font-size: 16px;
  overflow-wrap: anywhere;
}

.summary-list {
  margin-top: 20px;
  border-top: 1px solid var(--color-border);
}

.summary-list__row {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
  gap: 18px;
  border-bottom: 1px solid var(--color-border);
  padding: 10px 0;
}

.summary-list__row span {
  color: var(--color-muted);
}

.summary-list__row strong {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.summary-list--compact {
  max-width: 760px;
  margin-top: 12px;
}

.summary-list--compact .summary-list__row {
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
}

.form-row {
  margin-bottom: 16px;
}

.form-alert-slot {
  min-height: 48px;
  margin-bottom: 12px;
}

.form-alert {
  border: 1px solid #e0b5b5;
  border-left: 4px solid #a32929;
  background: #fff7f7;
  padding: 10px 12px;
  color: #5f1717;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

/* Поля формы */
input,
select {
  width: 100%;
  max-width: 420px;
  min-height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  padding: 8px 10px;
  font: inherit;
}

textarea {
  width: 100%;
  max-width: 620px;
  min-height: 86px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  padding: 8px 10px;
  font: inherit;
  resize: vertical;
}

.password-tools {
  width: min(420px, 100%);
  margin-bottom: 16px;
}

.password-tools .form-row {
  margin-bottom: 12px;
}

.password-tools__input {
  display: flex;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  max-width: 420px;
}

.password-tools__input input {
  flex: 1 1 auto;
  min-width: 0;
}

.password-tools__buttons {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 6px;
}

.password-tools__button {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
}

.password-tools__button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.password-tools__icon {
  display: inline-flex;
}

.password-tools__icon--hide,
.password-tools__toggle.is-visible .password-tools__icon--show {
  display: none;
}

.password-tools__toggle.is-visible .password-tools__icon--hide {
  display: inline-flex;
}

.password-tools__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  max-width: 420px;
  margin-top: 8px;
}

.password-tools__actions .help-text {
  margin-top: 0;
}

.dropzone {
  width: min(620px, 100%);
  min-height: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed var(--color-border);
  background: #fff;
  padding: 20px;
  cursor: pointer;
  text-align: center;
}

.dropzone input {
  width: auto;
  max-width: 100%;
  min-height: auto;
  border: 0;
  padding: 0;
}

.dropzone__title {
  font-weight: 700;
}

.dropzone__meta {
  color: var(--color-muted);
  overflow-wrap: anywhere;
}

.dropzone--selected {
  border-color: var(--color-primary);
  background: #f4f8ff;
}

.dropzone--selected .dropzone__meta {
  max-width: 100%;
  border: 1px solid #c8d6e8;
  border-radius: var(--radius-control);
  background: #fff;
  color: var(--color-text);
  padding: 7px 10px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.dropzone--active {
  border-color: var(--color-primary);
  background: #eef4ff;
}

.dropzone--error {
  border-color: #a32929;
}

.info-note--warning {
  border-color: #e0b44f;
  background: #fff8e7;
  color: #5b4100;
}

.confirmation-control {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.confirmation-control input {
  width: auto;
  min-height: auto;
  margin-top: 3px;
}

/* Кнопки */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-control);
  padding: 6px 12px;
  background: var(--color-primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:disabled {
  border-color: #b6c0cb;
  background: #d8dee7;
  color: #697584;
  cursor: not-allowed;
}

.button--secondary {
  background: #fff;
  color: var(--color-primary);
}

.button--warning {
  border-color: #b97800;
  background: #fff8e7;
  color: #5b4100;
}

.button--warning:hover,
.button--warning:focus-visible {
  background: #ffefbf;
}

.button--active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text);
}

.button--logout {
  background: transparent;
  border-color: #b8c0ca;
  color: #4f5d6f;
}

.button--logout:hover {
  background: #f3f6fa;
  border-color: #8f9bab;
  color: var(--color-text);
}

.button--impersonation {
  border-color: #bf8a00;
  background: #fff7df;
  color: #684800;
}

.button--impersonation:hover,
.button--impersonation:focus-visible,
.button--impersonation.button--active {
  border-color: #9c6f00;
  background: #fab400;
  color: #1d1d1b;
}

.button--wide {
  width: 100%;
  max-width: 420px;
}

.button--small {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
}

.button--table {
  min-height: 34px;
  padding: 5px 9px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-control);
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.icon-button--secondary,
.icon-button--ghost {
  background: #fff;
  color: var(--color-primary);
}

.icon-button--ghost {
  border-color: transparent;
}

.icon-button--ghost:hover {
  border-color: var(--color-border);
  background: #f4f8ff;
}

.messages {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.messages li {
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  background: #fff;
  padding: 10px 12px;
}

/* Таблицы */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid var(--color-border);
  padding: 10px;
  text-align: left;
}

.table--compact th,
.table--compact td {
  padding: 6px 8px;
  vertical-align: top;
}

.selection-results-table,
.data-items-table,
.users-table {
  width: 100%;
  table-layout: fixed;
  font-size: 13px;
}

.selection-results-table th,
.selection-results-table td,
.data-items-table th,
.data-items-table td,
.users-table th,
.users-table td {
  border-right: 1px solid var(--color-table-border);
  padding: 6px 8px;
  text-align: center;
  white-space: nowrap;
}

.selection-results-table th:first-child,
.selection-results-table td:first-child,
.data-items-table th:first-child,
.data-items-table td:first-child,
.users-table th:first-child,
.users-table td:first-child {
  border-left: 1px solid var(--color-table-border);
}

.selection-results-table thead th,
.data-items-table thead th,
.users-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--color-table-head-bg);
  border-right: 1px solid var(--color-border-strong);
  border-bottom: 2px solid var(--color-table-head-border);
  color: var(--color-table-head-text);
  font-weight: 700;
}

.data-items-table tbody tr:hover,
.users-table tbody tr:hover {
  background: var(--color-table-hover);
}

/* Подбор */
.selection-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.selection-parameters {
  display: grid;
  flex: 0 0 auto;
  gap: 4px;
  max-width: 100%;
  padding: 10px 12px 12px;
  border: 1px solid #d5e0ec;
  border-radius: var(--radius-panel);
  background: #f4f8fd;
}

.selection-parameters__layout {
  display: grid;
  grid-template-columns: minmax(442px, auto) minmax(300px, 340px);
  align-items: start;
  gap: 16px;
}

.selection-parameters__action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 7px;
  border-top: 1px solid #dbe5f1;
}

.selection-input-fields {
  display: grid;
  align-content: start;
  gap: 4px;
}

.selection-valve-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(214px, auto));
  align-items: start;
  gap: 14px;
}

.selection-parameter-section {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.selection-parameter-section--drive {
  align-self: stretch;
  box-sizing: border-box;
  padding-left: 16px;
  border-left: 1px solid #d5e0ec;
}

.selection-parameter-section__title {
  color: var(--color-table-head-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.selection-inline-field {
  position: relative;
  display: grid;
  grid-template-columns: 130px 76px;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.selection-inline-field label {
  margin: 0;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 30px;
  font-size: 13px;
  line-height: 1.15;
  text-align: left;
}

.selection-inline-field__control {
  display: flex;
  align-items: center;
  width: 76px;
  min-height: 30px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: #fff;
  overflow: hidden;
}

.selection-inline-field__control input,
.selection-inline-field__control select {
  width: 100%;
  min-height: 28px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 4px 7px;
}

.selection-inline-field__control:not(:has(input.is-invalid)):not(:has(select.is-invalid)):focus-within {
  border-color: var(--color-primary);
}

.selection-inline-field__control input:focus,
.selection-inline-field__control select:focus {
  outline: 0;
}

.selection-inline-field__control input::-webkit-outer-spin-button,
.selection-inline-field__control input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.selection-inline-field__control input[type="number"] {
  appearance: textfield;
}

.selection-inline-field__control:has(input:disabled),
.selection-inline-field__control:has(select:disabled) {
  background: var(--color-bg);
}

.selection-inline-field__control input:disabled,
.selection-inline-field__control select:disabled {
  color: var(--color-muted);
  background: transparent;
  cursor: not-allowed;
}

.selection-inline-field--invalid .selection-inline-field__control,
.selection-inline-field__control:has(input.is-invalid),
.selection-inline-field__control:has(select.is-invalid) {
  border-color: var(--color-danger);
}

.selection-inline-field--invalid .selection-inline-field__control input,
.selection-inline-field--invalid .selection-inline-field__control select,
.selection-inline-field__control input.is-invalid,
.selection-inline-field__control select.is-invalid {
  background: #fff7f7;
  box-shadow: none;
}

.selection-inline-field--disabled-note {
  cursor: help;
}

.selection-inline-field--disabled-note label {
  color: #7b6d42;
}

.selection-inline-field--disabled-note .selection-inline-field__control {
  border-color: #d8c98d;
  background: #fbf8e8;
}

.selection-target-parameter {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.selection-inline-field--target {
  grid-template-columns: auto 64px;
  min-height: 32px;
}

.selection-inline-field--target label {
  color: var(--color-table-head-text);
  font-weight: 700;
}

.selection-inline-field--target .selection-inline-field__control {
  width: 64px;
  border-color: #aebfda;
  background: #fff;
}

.selection-extra-parameters__controls {
  display: grid;
  align-content: start;
  gap: 6px;
}

.selection-parameter-checkbox {
  display: grid;
  grid-template-columns: 130px 16px;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.selection-parameter-checkbox input[type="checkbox"] {
  justify-self: start;
  width: 15px;
  height: 15px;
  min-height: 0;
  margin: 0;
  accent-color: var(--color-primary);
}

.selection-extra-parameters__group {
  position: relative;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.selection-extra-parameters__group > label {
  margin: 0;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.selection-extra-parameters__group .selection-field__client-error {
  grid-column: 2;
}

.selection-extra-parameters__group .selection-group-filter {
  min-width: 0;
  width: 100%;
}

.selection-extra-parameters__group .selection-group-filter__button {
  min-width: 0;
  width: 100%;
}

.selection-extra-parameters__group [data-selection-group-label] {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-bar__button {
  width: 132px;
  min-height: 36px;
}

.selection-data-panel {
  align-self: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  align-content: start;
  flex: 0 0 250px;
  gap: 7px;
  min-width: 240px;
  max-width: 100%;
  padding: 10px 12px 12px;
  border: 1px solid #d5e0ec;
  border-radius: var(--radius-panel);
  background: #f4f8fd;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.15;
}

.selection-data-panel__title {
  color: var(--color-table-head-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
}

.selection-data-panel__item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
}

.selection-data-panel__label {
  min-width: 0;
  color: var(--color-muted);
  font-weight: 700;
  line-height: 1.2;
}

.selection-data-panel__value {
  min-width: 0;
  color: var(--color-text);
  line-height: 1.2;
  overflow-wrap: break-word;
}

.selection-data-panel__value strong {
  color: var(--color-text);
  font-weight: 700;
}

.selection-data-panel__meta {
  display: block;
  margin-top: 2px;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.15;
}

.selection-view-panel {
  align-self: stretch;
  display: grid;
  align-content: start;
  flex: 0 0 auto;
  gap: 7px;
  width: min(340px, 100%);
  max-width: 100%;
  min-width: 0;
  padding: 10px 12px 12px;
  border: 1px solid #d5e0ec;
  border-radius: var(--radius-panel);
  background: #f4f8fd;
}

.selection-view-panel--service-only {
  align-self: flex-start;
  flex: 0 1 auto;
  width: min(168px, 100%);
}

.selection-view-panel__title {
  color: var(--color-table-head-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.selection-view-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 20px;
}

.selection-view-panel__controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  gap: 7px 6px;
}

.selection-view-panel .selection-highlight-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.15;
}

.selection-view-panel .selection-highlight-toggle:hover {
  border-color: #edf1f6;
  background: #f6f8fb;
}

.selection-view-panel .selection-highlight-toggle span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-view-panel .selection-highlight-toggle input[type="checkbox"] {
  justify-self: end;
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--color-primary);
}

.selection-view-panel .selection-highlight-toggle input[type="checkbox"]:focus {
  outline: 2px solid rgba(26, 71, 152, 0.28);
  outline-offset: 2px;
}

.selection-view-panel .selection-highlight-help {
  width: 20px;
  height: 20px;
  background: #fff;
  font-size: 12px;
}

.selection-table-filter-button {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid #d5e0ec;
  border-radius: var(--radius-control);
  background: #fff;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
}

.selection-table-filter-button:hover,
.selection-table-filter-button:focus {
  border-color: var(--color-primary);
  outline: none;
}

.selection-table-filter-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-table-filter-button strong {
  color: var(--color-table-head-text);
  font-weight: 700;
  white-space: nowrap;
}

.selection-drive-group-modal__card {
  width: min(720px, calc(100vw - 32px));
}

.selection-drive-group-modal__actions {
  margin-top: 14px;
  padding-bottom: 4px;
}

.selection-drive-group-filter {
  display: grid;
  gap: 14px;
}

.selection-drive-group-filter__mode {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #d5e0ec;
  border-radius: var(--radius-panel);
  background: #f4f8fd;
}

.selection-drive-group-filter__mode-title {
  color: var(--color-table-head-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.selection-drive-group-filter__mode-control {
  justify-self: start;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(360px, 100%);
  height: 32px;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #c6d3e2;
  border-radius: var(--radius-control);
  background: #fff;
}

.selection-drive-group-filter__mode-control--three {
  grid-template-columns: 58px 148px 178px;
  width: fit-content;
  max-width: 100%;
}

.selection-drive-group-filter__mode-option {
  position: relative;
  display: flex;
  align-items: stretch;
  box-sizing: border-box;
  height: 100%;
  min-width: 0;
  background: #fff;
}

.selection-drive-group-filter__mode-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.selection-drive-group-filter__mode-option span {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 9px;
  color: var(--color-table-head-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.selection-drive-group-filter__mode-option + .selection-drive-group-filter__mode-option span {
  border-left: 1px solid #c6d3e2;
}

.selection-drive-group-filter__mode-option:has(input:checked) {
  background: var(--color-primary);
}

.selection-drive-group-filter__mode-option input:checked + span {
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
}

.selection-drive-group-filter__mode-option input:focus-visible + span {
  outline: 2px solid rgba(26, 71, 152, 0.32);
  outline-offset: -2px;
}

.selection-drive-group-filter__manufacturers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.selection-drive-group-filter__manufacturer {
  min-width: 0;
  padding: 10px;
  border: 1px solid #d5e0ec;
  border-radius: var(--radius-panel);
  background: #fff;
}

.selection-drive-group-filter--inactive-options .selection-drive-group-filter__manufacturer {
  border-color: #dde4ee;
  background: #f7f9fc;
}

.selection-drive-group-filter__manufacturer h3 {
  margin: 0 0 8px;
  color: var(--color-table-head-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.selection-drive-group-filter__groups {
  display: grid;
  gap: 6px;
}

.selection-drive-group-filter__group {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.15;
}

.selection-drive-group-filter--inactive-options .selection-drive-group-filter__manufacturer h3,
.selection-drive-group-filter--inactive-options .selection-drive-group-filter__group {
  color: #9aa4b2;
}

.selection-drive-group-filter__group input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--color-primary);
}

.selection-drive-group-filter--inactive-options .selection-drive-group-filter__group input {
  opacity: 0.48;
}

.selection-drive-group-filter__group span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1500px) {
  .selection-view-panel__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    justify-content: flex-start;
  }

}

.selection-workspace {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.selection-workspace--with-results {
  flex: 1 1 auto;
  min-height: 0;
}

.selection-workspace__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "form";
  gap: 0;
  align-items: end;
}

.selection-workspace__form {
  grid-area: form;
  min-width: 0;
}

.selection-workspace__form .selection-bar {
  flex-wrap: nowrap;
}

.selection-workspace .selection-results-wrap {
  min-height: 0;
  padding-top: 0;
  border: 1px solid #c6d4e5;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  overflow: auto;
}

.selection-highlight-toggle {
  min-height: 34px;
  white-space: nowrap;
}

.selection-highlight-control {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.selection-highlight-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid #9fb0c6;
  border-radius: 50%;
  background: #f7f9fc;
  color: #17356e;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.selection-highlight-help:hover,
.selection-highlight-help:focus-visible {
  border-color: var(--color-accent);
  color: var(--color-accent);
  outline: none;
}

.selection-alternative-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-height: 18px;
  border: 1px solid #a9bdd4;
  border-radius: 50%;
  background: #eef5ff;
  color: #17356e;
  cursor: help;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  margin-left: 4px;
  padding: 0;
  white-space: nowrap;
}

.selection-alternative-badge[hidden] {
  display: none;
}

.selection-value-badge {
  border-color: #79a88b;
  background: #edf8f0;
  color: #1f6b3b;
}

.selection-group-filter {
  position: relative;
  min-width: 150px;
}

.selection-field--groups {
  min-width: 150px;
}

.selection-field--groups .selection-group-filter {
  width: 100%;
}

.selection-field--test-gearbox {
  min-width: 190px;
}

.selection-field--test-ratios {
  min-width: 170px;
}

.selection-field--test-ratios .selection-field__control input {
  width: 170px;
}

.selection-field--test-drives {
  min-width: 220px;
  width: 270px;
}

.selection-test-panel__option {
  flex: 0 0 auto;
  min-height: 34px;
  color: var(--color-text);
  line-height: 1.2;
  white-space: nowrap;
}

.selection-source-filter {
  min-width: 220px;
  width: 100%;
}

.selection-source-filter .selection-group-filter__button {
  min-width: 0;
  width: 100%;
}

.selection-source-filter [data-selection-source-label] {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-group-filter__button {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: #fff;
  color: var(--color-text);
  cursor: pointer;
  font: inherit;
  line-height: 1.2;
  padding: 6px 28px 6px 10px;
  position: relative;
  text-align: left;
  white-space: nowrap;
  list-style: none;
}

.selection-group-filter__button::-webkit-details-marker {
  display: none;
}

.selection-group-filter__button::after {
  content: "▾";
  position: absolute;
  right: 10px;
  top: 50%;
  color: var(--color-muted);
  font-size: 11px;
  transform: translateY(-50%);
}

.selection-group-filter[open] .selection-group-filter__button::after {
  content: "▴";
}

.selection-group-filter__menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  right: 0;
  width: max-content;
  min-width: 240px;
  max-width: 320px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-panel);
  background: #fff;
  box-shadow: var(--shadow-tooltip);
  padding: 6px;
}

.selection-group-filter:not([open]) .selection-group-filter__menu {
  display: none;
}

.selection-group-filter__option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  border-radius: var(--radius-control);
  color: var(--color-text);
  cursor: pointer;
  font-size: 13px;
  padding: 5px 7px;
  user-select: none;
}

.selection-group-filter__option:hover {
  background: var(--color-table-hover);
}

.selection-group-filter__option input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.selection-group-filter__option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-group-filter__option--all {
  border-bottom: 1px solid var(--color-border);
  border-radius: var(--radius-control) var(--radius-control) 0 0;
  margin-bottom: 4px;
  padding-bottom: 8px;
}

.data-freshness {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.25;
}

.data-freshness__item {
  min-width: 0;
}

.data-freshness__item + .data-freshness__item::before {
  content: "·";
  margin-right: 8px;
  color: var(--color-border);
}

.data-freshness--table {
  flex: 0 0 auto;
  margin: 0 0 4px;
}

.data-freshness--compact {
  flex: 0 1 auto;
  justify-content: flex-end;
  gap: 6px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.data-freshness--compact .data-freshness__item + .data-freshness__item::before {
  margin-right: 6px;
}

.data-freshness strong {
  color: var(--color-text);
}

.data-table-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin: 0 0 10px;
}

.data-table-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
}

.data-table-filter select {
  min-width: 220px;
}

.data-table-sort-toggle {
  color: var(--color-text);
}

.selection-field {
  position: relative;
  display: grid;
  grid-template-rows: 30px 34px;
  gap: 4px;
  min-width: 112px;
  padding: 0;
}

.selection-field label {
  margin: 0;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

.selection-field__control {
  display: flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: #fff;
  overflow: hidden;
}

.selection-field__control input {
  width: 112px;
  min-height: 32px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 5px 9px;
}

.selection-field__control select {
  width: 100%;
  max-width: none;
  min-height: 32px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 5px 9px;
}

.selection-field__control:not(.selection-field__control--checkbox):not(:has(input.is-invalid)):not(:has(select.is-invalid)):focus-within {
  border-color: var(--color-primary);
}

.selection-field__control:not(.selection-field__control--checkbox) input:focus {
  outline: 0;
}

.selection-field__control input::-webkit-outer-spin-button,
.selection-field__control input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.selection-field__control input[type="number"] {
  appearance: textfield;
}

.selection-field__control:not(.selection-field__control--checkbox) select:focus {
  outline: 0;
}

.selection-field--invalid .selection-field__control,
.selection-field__control:has(input.is-invalid),
.selection-field__control:has(select.is-invalid) {
  border-color: var(--color-danger);
}

.selection-field--invalid .selection-field__control input,
.selection-field--invalid .selection-field__control select,
.selection-field__control input.is-invalid,
.selection-field__control select.is-invalid {
  background: #fff7f7;
  box-shadow: none;
}

.selection-field__client-error {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 20;
  max-width: min(240px, calc(100vw - 32px));
  border: 1px solid #e0b5b5;
  border-radius: var(--radius-control);
  background: #fff7f7;
  box-shadow: var(--shadow-tooltip);
  color: var(--color-danger);
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.selection-field__client-error[hidden] {
  display: none;
}

.selection-field__client-error::before {
  content: "";
  position: absolute;
  left: 12px;
  top: -5px;
  width: 8px;
  height: 8px;
  border-top: 1px solid #e0b5b5;
  border-left: 1px solid #e0b5b5;
  background: #fff7f7;
  transform: rotate(45deg);
}

/* Загрузки */
.file-documents-panel__top {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

.file-documents-panel__summary {
  min-width: 0;
}

.file-documents-panel__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.file-documents-panel__actions .button {
  white-space: nowrap;
}

.file-documents-panel__title {
  margin: 0 0 8px;
  color: var(--color-text);
  font-size: 18px;
  line-height: 1.25;
}

.table-scroll {
  width: 100%;
  min-height: 0;
  overflow: auto;
}

.file-documents-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.file-documents-panel h2 {
  flex: 0 0 auto;
}

.file-documents-tabs {
  gap: 10px;
}

.file-tabs {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.file-tabs__button.is-active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text);
}

.file-tab-panel {
  min-height: 0;
}

.file-tab-panel.is-active {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.file-tab-panel[hidden] {
  display: none;
}

.selection-results-wrap,
.file-table-scroll {
  flex: 1 1 auto;
}

.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 400;
  user-select: none;
}

.toggle-control input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.app-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 320px;
  border: 1px solid #9fb0c6;
  border-radius: var(--radius-control);
  background: #f7f9fc;
  color: #17356e;
  padding: 6px 9px;
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
  pointer-events: none;
  box-shadow: var(--shadow-tooltip);
}

.app-tooltip__line + .app-tooltip__line {
  margin-top: 3px;
}

.selection-results-table {
  min-width: 1515px;
}

.selection-results-table--with-drive-groups {
  min-width: 1625px;
}

.selection-results-table thead th {
  line-height: 1.2;
  vertical-align: middle;
}

.selection-results-table tbody td {
  padding: 3px 6px;
  line-height: 1.2;
  vertical-align: middle;
}

.selection-results-table thead button {
  position: relative;
  width: 100%;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  padding: 0 13px 0 0;
  text-align: center;
}

.selection-results-table thead button::after {
  content: "↕";
  position: absolute;
  right: 0;
  top: 50%;
  color: #6d7f98;
  font-size: 11px;
  transform: translateY(-50%);
}

.selection-results-table thead th[aria-sort="ascending"] button::after {
  content: "↑";
  color: var(--color-primary);
}

.selection-results-table thead th[aria-sort="descending"] button::after {
  content: "↓";
  color: var(--color-primary);
}

.selection-results-table__time-head button {
  padding-right: 13px;
}

.selection-results-table thead th:first-child {
  border-left: 1px solid var(--color-border-strong);
}

.selection-results-table .col-model {
  overflow: hidden;
  text-overflow: ellipsis;
}

.selection-results-table tbody tr {
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

.selection-results-table tbody tr:hover {
  background: var(--color-selection-table-hover);
}

.selection-results-table tbody tr:hover td {
  background: var(--color-selection-table-hover) !important;
}

.selection-results-table--recommendation-highlight tbody tr.recommended-row td {
  background: var(--color-recommendation-row);
}

.selection-results-table--recommendation-highlight tbody td.price-tier--lowest {
  background: var(--color-recommendation-best);
  font-weight: 700;
}

.selection-results-table--recommendation-highlight tbody td.price-tier--low {
  background: var(--color-recommendation-low);
}

.selection-results-table--recommendation-highlight tbody td.price-tier--medium {
  background: var(--color-recommendation-medium);
}

.selection-results-table--recommendation-highlight tbody td.price-tier--high {
  background: var(--color-recommendation-high);
}

.selection-results-table tbody td.cell-price-band {
  font-weight: 700;
  text-transform: lowercase;
}

.selection-results-table tbody td.price-band--1 {
  background: #dff4e6;
  color: #14532d;
}

.selection-results-table tbody td.price-band--2 {
  background: #edf8df;
  color: #365314;
}

.selection-results-table tbody td.price-band--3 {
  background: #fff4c7;
  color: #713f12;
}

.selection-results-table tbody td.price-band--4 {
  background: #ffe3c2;
  color: #7c2d12;
}

.selection-results-table tbody td.price-band--5 {
  background: #fbd4d4;
  color: #7f1d1d;
}

.selection-results-table tbody td.price-band--unknown {
  background: #eef2f7;
  color: var(--color-muted);
  font-weight: 600;
}

.selection-results-table tbody td.price-band--missing,
.selection-results-table tbody tr.selection-row--missing-price td.cell-price-band {
  background: #eef2f7;
  color: #526273;
  font-weight: 700;
}

.selection-results-table tbody tr.selection-row--missing-price td {
  color: #526273;
}

.cell-price-band {
  white-space: normal !important;
}

.price-band-label {
  display: block;
}

.selection-results-table tbody td.recommended-time-cell,
.selection-results-table--recommendation-highlight tbody td.recommended-time-cell {
  background: var(--color-recommendation-best);
  color: inherit;
  font-weight: 700;
  box-shadow: none;
}

.selection-results-table tbody td.best-overall-time-cell,
.selection-results-table--recommendation-highlight tbody td.best-overall-time-cell {
  background: var(--color-recommendation-medium);
  color: inherit;
  font-weight: 700;
  box-shadow: none;
}

.selection-results-table tbody td.best-overall-time-cell.recommended-time-cell,
.selection-results-table--recommendation-highlight tbody td.best-overall-time-cell.recommended-time-cell {
  background: var(--color-recommendation-best);
  color: inherit;
  box-shadow: inset 0 0 0 2px rgba(22, 101, 52, 0.32);
}

.selection-test-panel {
  min-width: 0;
}

.selection-test-panel__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid #d8e2ef;
  border-radius: var(--radius-control);
  background: #fff;
  color: #687789;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.selection-test-panel__toggle input {
  accent-color: #d28a00;
}

.selection-test-panel__toggle:has(input:checked) {
  border-color: #f0bc62;
  background: #fff3d8;
  box-shadow: inset 3px 0 0 #f0a928;
  color: #6b4a08;
}

.selection-test-settings {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 10px;
  margin-top: 6px;
  padding: 6px 10px;
  border: 1px solid #efc878;
  border-radius: var(--radius-panel);
  background: #fff8e8;
  box-shadow: inset 3px 0 0 #f0a928;
}

.selection-test-panel--inactive .selection-test-settings {
  display: none;
}

.selection-test-settings__label {
  color: #6b4a08;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.selection-test-settings__controls {
  display: grid;
  grid-template-columns: minmax(190px, 0.95fr) minmax(190px, 0.9fr) auto minmax(230px, 0.9fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.selection-test-settings .selection-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.selection-test-settings .selection-field label {
  justify-content: flex-start;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.selection-test-settings .selection-field__control input,
.selection-test-settings .selection-field__control select {
  min-height: 28px;
  width: 100%;
}

.selection-test-settings .selection-field__control,
.selection-test-settings .selection-source-filter .selection-group-filter__button {
  min-height: 30px;
}

.selection-test-settings .selection-field__control input,
.selection-test-settings .selection-field__control select {
  padding-top: 4px;
  padding-bottom: 4px;
}

.selection-test-settings__option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 30px;
  margin: 0;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.selection-test-settings__option input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  flex: 0 0 16px;
}

.selection-test-settings .selection-field--test-drives {
  position: relative;
  width: 100%;
}

.selection-test-settings .selection-source-filter {
  position: relative;
  width: 100%;
}

.selection-test-settings .selection-source-filter .selection-group-filter__menu {
  z-index: 40;
  right: auto;
  left: 0;
  width: 100%;
  min-width: 260px;
  max-width: none;
  max-height: 260px;
}

.selection-test-panel [data-selection-test-disabled] {
  pointer-events: none;
}

.selection-results-table tbody tr.selection-row--torque-excess td.cell-torque-excess {
  background: #fff4d8 !important;
  box-shadow: inset 0 0 0 2px #d28a00;
  color: #5b4100;
  font-weight: 700;
}

.selection-results-table tbody tr.selection-row--valve-torque-excess td.cell-torque-excess {
  background: #fff0f0 !important;
  box-shadow: inset 0 0 0 2px #c53030;
  color: #7a1515;
  font-weight: 700;
}

.selection-results-table tbody td.cell-test-ratio,
.selection-results-table tbody tr:hover td.cell-test-ratio {
  background: #fff1bf !important;
  box-shadow: inset 0 0 0 2px var(--color-accent);
  color: var(--color-text);
  font-weight: 700;
}

.selection-results-table tbody td.cell-connection--missing,
.selection-results-table tbody tr:hover td.cell-connection--missing {
  background: #fff7df !important;
  color: #6a4b00;
  font-weight: 700;
}

.selection-results-table tbody td.cell-connection--mismatch,
.selection-results-table tbody tr:hover td.cell-connection--mismatch {
  background: #fdecea !important;
  color: #8a241e;
  font-weight: 700;
}

.selection-results-table__row-number {
  width: 50px;
}

.selection-results-table__gearbox {
  width: 280px;
}

.selection-results-table__drive-group {
  width: 110px;
}

.selection-results-table__drive {
  width: auto;
}

.selection-results-table__connection {
  width: 160px;
}

.selection-results-table__explosion {
  width: 135px;
}

.selection-results-table__torque {
  width: 170px;
}

.selection-results-table__margin {
  width: 90px;
}

.selection-results-table__time {
  width: 112px;
}

.selection-results-table__price {
  width: 110px;
}

.selection-results-table__price:last-child,
.selection-results-table__price-total {
  width: 125px;
}

.selection-results-table__report {
  width: 48px;
}

.selection-report-head,
.cell-report-action {
  padding-right: 4px !important;
  padding-left: 4px !important;
}

.selection-report-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: #17356e;
  line-height: 1;
  text-decoration: none;
}

.selection-report-link:hover {
  background: #eef5ff;
}

.selection-report-link:focus-visible {
  background: #eef5ff;
  outline: 2px solid #bfd1e7;
  outline-offset: 1px;
}

.selection-report-link:focus:not(:focus-visible) {
  outline: none;
}

.selection-report-icon {
  display: block;
  width: 22px;
  height: 22px;
}

.data-items-table {
  min-width: 1480px;
  border-collapse: separate;
  border-spacing: 0;
}

.data-items-table__col-row-number {
  width: 50px;
}

.data-items-table__col-model {
  width: 280px;
}

.data-items-table__col-ratios {
  width: 260px;
}

.data-items-table__col-number,
.data-items-table__col-price {
  width: 140px;
}

.data-items-table__col-flag {
  width: 130px;
}

.data-items-table__col-note {
  width: 320px;
}

.data-items-table th,
.data-items-table td {
  height: 34px;
  line-height: 1.25;
  vertical-align: middle;
  overflow: hidden;
}

.data-items-table thead button {
  position: relative;
  width: 100%;
  min-height: 24px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  padding: 0 13px 0 0;
  text-align: center;
}

.data-items-table thead button::after {
  content: "\2195";
  position: absolute;
  right: 0;
  top: 50%;
  color: #6d7f98;
  font-size: 11px;
  transform: translateY(-50%);
}

.data-items-table thead th[aria-sort="ascending"] button::after {
  content: "\2191";
  color: var(--color-primary);
}

.data-items-table thead th[aria-sort="descending"] button::after {
  content: "\2193";
  color: var(--color-primary);
}

.data-items-table__name,
.data-items-table__note {
  text-align: left;
  text-overflow: ellipsis;
}

.data-items-table__group-row td {
  background: #f3f6fa;
  color: var(--color-table-head-text);
  font-weight: 800;
  text-align: left;
}

.row-number-cell {
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: center;
}

/* Админка */
.admin-users-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.admin-technical-panel {
  flex: 0 0 auto;
}

.admin-users-panel__header,
.admin-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.admin-users-panel__header h1,
.admin-users-panel__header p,
.admin-form-header h1 {
  margin-bottom: 6px;
}

.admin-form-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-users-table-scroll {
  flex: 1 1 auto;
}

.admin-users-table-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 10px;
}

.admin-users-inline-status {
  width: fit-content;
  margin: -4px 0 10px;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #f7f9fc;
  color: var(--color-text);
  font-size: 13px;
}

.admin-users-inline-status--success {
  border-color: #b7d9c4;
  background: #f2fbf5;
  color: #1d6b37;
}

.admin-users-inline-status--error {
  border-color: #e1b5b5;
  background: #fff5f5;
  color: #9a2f2f;
}

.admin-users-availability-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1;
  white-space: nowrap;
}

.admin-users-availability-toggle input {
  width: 13px;
  height: 13px;
  min-height: 13px;
  margin: 0;
}

.switch-user-table {
  min-width: 920px;
  table-layout: fixed;
  border: 1px solid #d7e0ec;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.switch-user-table th,
.switch-user-table td {
  padding: 8px 10px;
  border-right: 1px solid #edf2f8;
  border-bottom: 1px solid #e3e9f2;
  text-align: center;
  vertical-align: middle;
}

.switch-user-table th:last-child,
.switch-user-table td:last-child {
  border-right: 0;
}

.switch-user-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eaf1f9;
  border-bottom: 2px solid #9fb2cc;
  color: #0b3470;
  font-weight: 700;
  line-height: 1.2;
}

.switch-user-table tbody tr:hover td {
  background: #f6f9fd;
}

.switch-user-table__organization-col {
  width: 34%;
}

.switch-user-table__type-col {
  width: 170px;
}

.switch-user-table__drives-col {
  width: 150px;
}

.switch-user-table__login-col {
  width: 170px;
}

.switch-user-table__action-col {
  width: 124px;
}

.switch-user-table__organization,
.switch-user-table__login {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.switch-user-table td.switch-user-table__organization {
  color: #111827;
  font-weight: 700;
  text-align: left;
}

.switch-user-table__type-badge,
.switch-user-table__drive-status,
.switch-user-table__selected-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.switch-user-table__type-badge--drive {
  border: 1px solid #bfd7f2;
  background: #eef6ff;
  color: #123f73;
}

.switch-user-table__type-badge--valve {
  border: 1px solid #c9ddbd;
  background: #f2f7ee;
  color: #315f22;
}

.switch-user-table__drive-status--ready {
  border: 1px solid #bfd4ee;
  background: #edf5ff;
  color: #123f73;
}

.switch-user-table__drive-status--empty {
  border: 1px solid #d9e0ea;
  background: #f5f7fa;
  color: #687386;
}

.switch-user-table__empty {
  color: var(--color-muted);
}

.switch-user-table__action {
  text-align: center;
}

.switch-user-table__action form {
  margin: 0;
}

.switch-user-table__action-button {
  min-width: 92px;
}

.switch-user-table__selected-badge {
  border: 1px solid #9fbce6;
  background: #f1f6ff;
  color: #163e78;
}

.switch-user-table__current td {
  background: #e8f2ff;
}

.switch-user-table__current td:first-child {
  box-shadow: inset 3px 0 #1f4d93;
}

.admin-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.admin-tabs__version {
  margin-left: auto;
  color: var(--color-muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.activity-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.activity-tabs {
  margin-top: -2px;
}

.admin-section {
  flex: 0 0 auto;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.admin-section--deploy {
  display: grid;
  gap: 12px;
}

.settings-list {
  display: grid;
  gap: 12px;
}

.settings-list__form {
  display: grid;
  gap: 12px;
}

.settings-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 2fr);
  align-items: start;
  gap: 16px;
}

.settings-item__main {
  min-width: 0;
}

.settings-item__main h2 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.25;
}

.settings-item__main p {
  margin: 0;
}

.settings-item__actions {
  justify-self: start;
}

.settings-item--deploy {
  grid-template-columns: 1fr;
}

.activity-filter {
  display: flex;
  align-items: flex-end;
  gap: 8px 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.activity-filter__field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.activity-filter__field label {
  margin-bottom: 0;
}

.activity-filter__field select,
.activity-filter__field input {
  width: min(320px, 100%);
}

.activity-filter__field--ip input {
  width: min(160px, 100%);
}

.activity-filter__field--period select {
  width: min(140px, 100%);
}

.activity-context {
  margin: 0 0 10px;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.35;
}

.activity-context strong {
  color: var(--color-text);
  font-weight: 700;
}

.activity-context__reset {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
}

.activity-analysis-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(230px, 0.74fr) minmax(330px, 1.16fr) minmax(310px, 1.1fr);
  grid-template-rows: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  margin: 4px 0 12px;
  max-width: 100%;
  min-height: 0;
}

.activity-analysis-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px 10px;
}

.activity-analysis-block h3 {
  margin: -8px -10px 8px;
  padding: 8px 10px 7px;
  border-bottom: 1px solid var(--color-border);
  background: #f6f9fc;
  color: #173f72;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.activity-access-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin: 0;
}

.activity-access-summary div {
  min-width: 0;
  padding: 2px 0;
}

.activity-access-summary dt {
  margin: 0 0 2px;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-access-summary dd {
  margin: 0;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.activity-analysis-scroll,
.activity-login-scroll {
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.activity-analysis-scroll {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
}

.activity-login-scroll {
  flex: 1 1 auto;
  min-width: 0;
  max-height: none;
  min-height: 0;
}

.activity-login-section {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
}

.activity-users-scroll {
  flex: 1 1 auto;
  max-width: 100%;
  max-height: none;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

.activity-analysis-table,
.activity-login-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  font-size: 13px;
}

.activity-ip-table__ip {
  width: 48%;
}

.activity-ip-table__users {
  width: 20%;
}

.activity-ip-table__sessions {
  width: 15%;
}

.activity-ip-table__visits {
  width: 17%;
}

.activity-login-table__time {
  width: 112px;
}

.activity-login-table__login {
  width: 150px;
}

.activity-login-table__ip {
  width: 124px;
}

.activity-login-table__result {
  width: 132px;
}

.activity-login-table__reason {
  width: auto;
}

.activity-login-table__admin {
  width: 52px;
}

.activity-login-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 18px;
  padding: 1px 6px;
  border: 1px solid #d7e1ec;
  border-radius: 4px;
  background: #f7fafc;
  color: var(--color-text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.activity-login-badge--success {
  border-color: #b7d8c2;
  background: #eef8f1;
  color: #21663a;
}

.activity-login-badge--failure {
  border-color: #f0c3c3;
  background: #fff2f2;
  color: #9b2f2f;
}

.activity-login-badge--locked {
  border-color: #e7bf8f;
  background: #fff6e8;
  color: #8a4a12;
}

.activity-login-badge--staff {
  border-color: #cad4e3;
  background: #f2f5f9;
  color: #40536b;
}

.activity-users-compact-table {
  width: 100%;
  min-width: 780px;
  table-layout: fixed;
  font-size: 13px;
}

.activity-analysis-table th,
.activity-analysis-table td,
.activity-login-table th,
.activity-login-table td {
  overflow: hidden;
  padding: 4px 8px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-ip-table th {
  padding: 3px 5px;
  line-height: 1.05;
  white-space: normal;
}

.activity-users-compact-table th,
.activity-users-compact-table td {
  overflow: hidden;
  padding: 2px 5px;
  line-height: 1.1;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.activity-analysis-table th,
.activity-login-table th,
.activity-users-compact-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid #b8c8da;
  background: #eef3f8;
  color: #173f72;
  font-weight: 700;
}

.activity-row-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px;
  align-items: center;
  gap: 4px;
  margin: 0;
  min-width: 0;
  min-height: 20px;
  padding: 1px 3px 1px 5px;
  border: 1px solid #d8e3f1;
  border-radius: 4px;
  background: #f8fbff;
  line-height: 1.1;
}

.activity-row-filter span {
  overflow: hidden;
  padding-right: 4px;
  border-right: 1px solid #d8e3f1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-row-filter input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-height: 14px;
  max-width: 14px;
  margin: 0;
  padding: 0;
  justify-self: end;
  accent-color: var(--color-primary);
}

.activity-row-filter:focus-within,
.activity-row-filter:has(input[type="checkbox"]:checked) {
  border-color: #9bb7dc;
  background: #edf5ff;
}

.activity-latest-scroll {
  flex: 1 1 auto;
  max-width: 100%;
  max-height: none;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

.activity-latest-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
  font-size: 12px;
}

.activity-latest-table th,
.activity-latest-table td {
  overflow: hidden;
  padding: 3px 6px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-latest-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid #b8c8da;
  background: #eef3f8;
  color: #173f72;
  font-weight: 700;
}

.activity-latest-table__time {
  width: 108px;
}

.activity-latest-table__login {
  width: 84px;
}

.activity-latest-table__ip {
  width: 102px;
}

.activity-latest-table__manufacturer {
  width: 138px;
}

.activity-latest-table__page {
  width: 150px;
}

.activity-latest-table__status {
  width: 76px;
}

.activity-visits-layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(500px, 1.08fr) minmax(540px, 0.92fr);
  gap: 12px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.activity-users-section {
  margin-top: 4px;
}

.activity-visits-layout .activity-users-section,
.activity-visits-layout .activity-latest-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px 10px;
  overflow: hidden;
}

.activity-visits-layout .admin-section__header {
  margin: -8px -10px 8px;
  padding: 8px 10px 7px;
  border-bottom: 1px solid var(--color-border);
  background: #f6f9fc;
}

.activity-visits-layout .admin-section__header h2 {
  color: #173f72;
  font-size: 14px;
  font-weight: 800;
}

.activity-latest-section {
  margin-bottom: 0;
}

.activity-pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.activity-pagination__ellipsis {
  color: var(--color-muted);
  padding: 0 2px;
}

@media (min-width: 1760px) {
  .activity-analysis-grid {
    grid-template-columns:
      minmax(230px, 0.62fr)
      minmax(340px, 0.96fr)
      minmax(320px, 0.9fr)
      minmax(760px, 1.72fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
  }

  .activity-login-section {
    grid-column: auto;
  }

  .activity-analysis-table {
    font-size: 12px;
  }

  .activity-analysis-table th,
  .activity-analysis-table td,
  .activity-login-table th,
  .activity-login-table td {
    padding: 3px 6px;
    line-height: 1.15;
  }
}

.admin-section__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.admin-section__header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.admin-section__header p {
  margin: 4px 0 0;
}

.admin-section__header--users {
  margin-bottom: 8px;
  padding-bottom: 0;
  border-bottom: 0;
}

.admin-site-settings {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 0;
}

.admin-site-settings__toggle {
  margin: 0;
}

.deploy-control-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: start;
  gap: 12px 18px;
}

.deploy-control-panel__main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.deploy-update-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.deploy-update-summary .deploy-status-note {
  min-height: 0;
}

.deploy-details {
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

.deploy-details summary {
  width: max-content;
  cursor: pointer;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.deploy-details__body {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.deploy-details .deploy-version-panel,
.deploy-details .admin-deploy-panel {
  padding-top: 0;
  border-top: 0;
}

.deploy-version-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.deploy-version-panel__header,
.admin-deploy-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.deploy-version-panel__header h3,
.admin-deploy-panel__header h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.deploy-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.deploy-fact {
  min-width: 0;
}

.deploy-fact dt {
  margin-bottom: 3px;
  color: var(--color-muted);
  font-size: 12px;
}

.deploy-fact dd {
  min-height: 20px;
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deploy-fact--branch dd,
.deploy-fact--remote dd {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.deploy-status-note {
  min-height: 20px;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.45;
}

.deploy-version-panel__message {
  margin: 6px 0 0;
  font-size: 13px;
}

.admin-deploy-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.admin-deploy-panel__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.admin-deploy-panel__empty {
  margin: 0;
  font-size: 13px;
}

.admin-deploy-actions {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}

.admin-deploy-form {
  min-width: 0;
}

.deploy-action-button {
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding-right: 12px;
  padding-left: 12px;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.deploy-action-button--primary {
  min-height: 48px;
  font-weight: 800;
}

.deploy-check-button {
  gap: 8px;
}

.deploy-check-button__marker {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
}

.deploy-check-button.is-checking .deploy-check-button__marker {
  opacity: 1;
  animation: deploy-check-pulse 1s ease-in-out infinite;
}

.admin-deploy-actions__hint {
  min-height: 0;
  margin: 2px 0 0;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.35;
}

.deploy-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--color-muted);
  font-size: 13px;
}

.deploy-runner-status {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-height: 24px;
  color: var(--color-muted);
  font-size: 13px;
}

.deploy-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--color-muted);
  font-size: 13px;
}

.deploy-progress {
  width: 160px;
  height: 14px;
  accent-color: var(--color-primary);
}

@keyframes deploy-check-pulse {
  0%,
  100% {
    transform: scale(0.85);
    opacity: 0.45;
  }

  50% {
    transform: scale(1.18);
    opacity: 1;
  }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: #fff;
  color: var(--color-muted);
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.status-pill--ok {
  border-color: #9dccaa;
  background: #effaf2;
  color: #1f6f38;
}

.status-pill--danger {
  border-color: #e0b5b5;
  background: #fff7f7;
  color: #8a2424;
}

.status-pill--unknown {
  border-color: #d8c388;
  background: #fff9e8;
  color: #6a4a00;
}

.status-pill--job {
  border-color: #c8d6e8;
  background: #f4f8ff;
  color: var(--color-primary);
}

.deploy-progress--wide {
  width: min(620px, 100%);
  height: 18px;
  margin-bottom: 12px;
}

.admin-deploy-detail {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.deploy-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 860px;
  margin-bottom: 12px;
}

.deploy-summary__item {
  border-left: 4px solid var(--color-accent);
  padding: 6px 0 6px 10px;
}

.deploy-summary__item span {
  display: block;
  color: var(--color-muted);
  font-size: 12px;
}

.deploy-summary__item strong {
  display: block;
  overflow-wrap: anywhere;
}

.deploy-message {
  margin-bottom: 14px;
}

.deploy-connection {
  margin: -4px 0 12px;
  color: var(--color-muted);
  font-size: 13px;
}

.deploy-connection--inline {
  margin: 0;
}

.deploy-connection[data-deploy-connection-state="lost"] {
  color: #8a2424;
}

.deploy-connection[data-deploy-connection-state="done"] {
  color: #1f6f38;
}

.deploy-final-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.deploy-final-actions[hidden] {
  display: none;
}

.deploy-final-actions--inline {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
}

.deploy-log-title {
  margin: 18px 0 8px;
  font-size: 18px;
}

.deploy-log {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: #111827;
  color: #f8fafc;
  padding: 12px;
  font: 12px/1.45 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
}

.deploy-modal {
  display: flex;
  flex-direction: column;
}

.deploy-modal__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  color: var(--color-muted);
  font-size: 13px;
}

.deploy-modal__log {
  flex: 1 1 auto;
  min-height: 260px;
  max-height: min(52vh, 520px);
  margin: 0 0 14px;
}

.users-table {
  min-width: 1500px;
  font-size: 13px;
}

.users-table th,
.users-table td {
  padding: 3px 6px;
  line-height: 1.2;
  vertical-align: middle;
}

.users-table thead th {
  padding-top: 3px;
  padding-bottom: 3px;
}

.users-table td:nth-child(1),
.users-table td:nth-child(3),
.users-table td:nth-child(8) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-table th:nth-child(1),
.users-table td:nth-child(1) {
  width: 250px;
}

.users-table th:nth-child(2),
.users-table td:nth-child(2) {
  width: 155px;
}

.users-table th:nth-child(3),
.users-table td:nth-child(3) {
  width: 110px;
}

.users-table th:nth-child(4),
.users-table td:nth-child(4) {
  width: 145px;
}

.users-table th:nth-child(5),
.users-table td:nth-child(5) {
  width: 170px;
}

.users-table th:nth-child(6),
.users-table td:nth-child(6) {
  width: 124px;
}

.users-table th:nth-child(7),
.users-table td:nth-child(7) {
  width: 64px;
}

.users-table th:nth-child(8),
.users-table td:nth-child(8) {
  width: 125px;
}

.users-table th:nth-child(9),
.users-table td:nth-child(9) {
  width: auto;
  min-width: 120px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.users-table th:nth-child(10),
.users-table td:nth-child(10) {
  width: 66px;
}

.users-table th:nth-child(11),
.users-table td:nth-child(11) {
  width: 140px;
}

.users-table__row--test-access td {
  background: #fff9ec;
}

.users-table__row--test-access td:first-child {
  box-shadow: inset 3px 0 #d58a00;
}

.users-table__access-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid #d1a246;
  border-radius: 4px;
  background: #fff3d7;
  color: #765100;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.users-table__access-empty {
  color: var(--color-muted);
}

.users-table__data-status {
  color: #173f72;
  font-weight: 700;
  white-space: nowrap;
}

.users-table__data-status--empty {
  color: var(--color-muted);
  font-weight: 600;
}

.users-table .button--table {
  min-height: 22px;
  padding: 2px 6px;
  font-size: 12px;
  line-height: 1;
}

.users-table__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.users-table__icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #bccbe0;
  border-radius: 4px;
  background: #fff;
  color: var(--color-primary);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.users-table__icon-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.users-table__icon-action--password {
  width: auto;
  min-width: 72px;
  gap: 4px;
  padding: 0 7px;
}

.users-table__icon-action--password svg {
  width: 15px;
  height: 15px;
}

.users-table__icon-action--primary {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

.users-table__icon-action--secondary {
  border-color: #9fb0c6;
  background: #f8fbff;
}

.users-table__icon-action--warning {
  border-color: #d1a246;
  background: #fff8e7;
  color: #7a5400;
}

.users-table__icon-action:hover,
.users-table__icon-action:focus-visible {
  border-color: var(--color-primary);
  background: #eaf2ff;
  color: var(--color-primary);
}

.users-table__icon-action--primary:hover,
.users-table__icon-action--primary:focus-visible {
  background: #153878;
  color: #fff;
}

.admin-users-confirm-modal,
.admin-users-result-modal {
  max-width: 420px;
}

.admin-users-password-modal {
  max-width: 520px;
}

.admin-users-password-tools {
  margin-bottom: 12px;
}

.admin-users-modal-field {
  position: relative;
}

.admin-users-modal-field--error input {
  border-color: #c23a3a;
  box-shadow: 0 0 0 1px rgba(194, 58, 58, 0.18);
}

.modal-field-error {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 4;
  max-width: min(360px, 100%);
  padding: 4px 7px;
  border: 1px solid #dfa3a3;
  border-radius: 5px;
  background: #fff6f6;
  box-shadow: var(--shadow-tooltip);
  color: #9a2f2f;
  font-size: 12px;
  line-height: 1.2;
}

.modal-field-error[hidden] {
  display: none;
}

.admin-user-form {
  width: min(860px, 100%);
  margin: 0 auto;
  overflow: auto;
}

.admin-user-form form {
  display: grid;
  gap: 10px;
}

.admin-user-form .form-row,
.admin-user-form__option-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: start;
  gap: 8px 12px;
  margin-bottom: 0;
}

.admin-user-form .form-row > label,
.admin-user-form__option-label {
  margin: 9px 0 0;
  font-weight: 700;
}

.admin-user-form .form-row > input,
.admin-user-form .form-row > select,
.admin-user-form .form-row > textarea,
.admin-user-form .form-row > .password-tools__input,
.admin-user-form .form-row > .help-text,
.admin-user-form .form-row > .errorlist,
.admin-user-form .form-row > .field-tooltip-error,
.admin-user-form__option-control {
  grid-column: 2;
}

.admin-user-form input,
.admin-user-form select,
.admin-user-form textarea {
  max-width: none;
}

.admin-user-form textarea {
  min-height: 62px;
}

.admin-user-form .form-row--error > input,
.admin-user-form .form-row--error > select,
.admin-user-form .form-row--error > textarea {
  border-color: #c23a3a;
  box-shadow: 0 0 0 1px rgba(194, 58, 58, 0.18);
}

.admin-user-form .field-tooltip-error {
  width: fit-content;
  max-width: min(420px, 100%);
  padding: 4px 7px;
  border: 1px solid #dfa3a3;
  border-radius: 5px;
  background: #fff6f6;
  box-shadow: var(--shadow-tooltip);
  color: #9a2f2f;
  font-size: 12px;
  line-height: 1.2;
}

.admin-user-form input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
}

.admin-user-form__active {
  justify-content: flex-start;
  margin: 0;
}

.admin-user-form__option-control .help-text,
.admin-user-form__option-control .errorlist {
  margin-top: 5px;
}

.admin-user-form .password-tools {
  width: 100%;
  margin-bottom: 0;
}

.admin-user-form .password-tools__input {
  max-width: none;
}

.admin-user-form .form-alert-slot,
.admin-user-form .form-actions {
  margin-bottom: 0;
}

.admin-user-form .form-actions {
  padding-left: 182px;
}

@media (max-width: 720px) {
  .admin-user-form .form-row,
  .admin-user-form__option-row {
    grid-template-columns: 1fr;
  }

  .admin-user-form .form-row > label,
  .admin-user-form__option-label {
    margin-top: 0;
  }

  .admin-user-form .form-row > input,
  .admin-user-form .form-row > select,
  .admin-user-form .form-row > textarea,
  .admin-user-form .form-row > .password-tools__input,
  .admin-user-form .form-row > .help-text,
  .admin-user-form .form-row > .errorlist,
  .admin-user-form .form-row > .field-tooltip-error,
  .admin-user-form__option-control {
    grid-column: 1;
  }

  .admin-user-form .form-actions {
    padding-left: 0;
  }
}

.form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.help-text {
  max-width: 620px;
  margin-top: 5px;
  color: var(--color-muted);
  font-size: 13px;
}

.info-note {
  max-width: 620px;
  border: 1px solid #c8d6e8;
  border-left: 4px solid var(--color-primary);
  background: #f4f8ff;
  padding: 9px 11px;
  color: #244069;
  font-size: 13px;
  line-height: 1.35;
}

/* Модальные окна */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(29, 29, 27, 0.42);
  padding: 24px;
}

.modal-overlay.is-open {
  display: flex;
}

.modal-card {
  width: min(640px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--color-border);
  border-top: 5px solid var(--color-primary);
  border-radius: var(--radius-panel);
  background: #fff;
  box-shadow: var(--shadow-modal);
  padding: 18px;
}

.modal-card--wide {
  width: min(920px, 100%);
}

.modal-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.modal-card__header h2 {
  margin: 0;
}

.modal-card__subtitle {
  margin: 4px 0 0;
  color: var(--color-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.modal-card__close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: #fff;
  color: var(--color-text);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.modal-card .dropzone {
  position: relative;
  width: 100%;
  min-height: 150px;
}

.modal-card .dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.modal-card textarea,
.modal-card select {
  max-width: 100%;
}

.modal-card input {
  max-width: 100%;
}

.modal-card .form-row--error > input,
.modal-card .form-row--error > select,
.modal-card .form-row--error > textarea {
  border-color: #c23a3a;
  box-shadow: 0 0 0 1px rgba(194, 58, 58, 0.18);
}

.modal-card .field-tooltip-error {
  width: fit-content;
  max-width: min(420px, 100%);
  margin-top: 5px;
  padding: 4px 7px;
  border: 1px solid #dfa3a3;
  border-radius: 5px;
  background: #fff6f6;
  box-shadow: var(--shadow-tooltip);
  color: #9a2f2f;
  font-size: 12px;
  line-height: 1.2;
}

.modal-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.error-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  color: var(--color-muted);
  font-size: 13px;
}

.error-table-scroll {
  max-height: 360px;
  margin-bottom: 14px;
}

.error-table th:first-child,
.error-table td:first-child {
  width: 92px;
  white-space: nowrap;
}

.error-table td {
  vertical-align: top;
}

.error-copy-details {
  margin-bottom: 14px;
}

.error-copy-details summary {
  cursor: pointer;
  color: var(--color-primary);
  font-weight: 700;
}

.error-copy-text {
  max-height: 180px;
  margin: 10px 0 0;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: #f8f9fb;
  padding: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Утилиты */
.muted {
  color: var(--color-muted);
}

.crumb-line,
.section-kicker {
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

/* Пользовательская политика */
.policy-page {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 8px 0 24px;
}

.policy-document {
  width: min(960px, 100%);
  margin: 0 auto;
  white-space: normal;
}

.policy-document h1 {
  margin: 8px 0 18px;
  color: var(--color-primary);
  font-size: 28px;
  line-height: 1.2;
}

.policy-section {
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.policy-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.policy-section h2 {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.25;
}

.policy-section p {
  margin: 0 0 12px;
}

.policy-consent-page {
  width: 100%;
  flex: 1 1 auto;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

.policy-consent {
  width: min(760px, 100%);
}

.policy-consent h1 {
  margin-top: 0;
  color: var(--color-primary);
  font-size: 24px;
  line-height: 1.25;
}

.policy-consent__notice {
  margin-bottom: 18px;
}

.policy-consent__control {
  max-width: 620px;
  margin-bottom: 16px;
}

.policy-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

/* Логин */
.login-page {
  position: relative;
  min-height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 48px 0;
}

.login-page::before,
.login-page::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.login-page::before {
  inset: 42px 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
}

.login-page::after {
  right: 4%;
  bottom: 7%;
  width: 220px;
  height: 110px;
  border-top: 1px solid #c5c5c5;
  border-bottom: 1px solid #c5c5c5;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 13px,
      rgba(28, 62, 131, 0.14) 14px,
      rgba(28, 62, 131, 0.14) 15px
    );
  opacity: 0.55;
}

.login-frame {
  position: absolute;
  inset: 18px;
  border: 1px solid var(--color-border);
  border-left: 6px solid var(--color-accent);
  pointer-events: none;
}

.login-frame::before,
.login-frame::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 76px;
  opacity: 0.8;
}

.login-frame::before {
  top: 26px;
  left: 28px;
  border-top: 2px solid var(--color-primary);
  border-left: 2px solid var(--color-primary);
}

.login-frame::after {
  right: 28px;
  bottom: 26px;
  border-right: 2px solid var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  border: 1px solid var(--color-border);
  border-top: 5px solid var(--color-primary);
  background: #fff;
  box-shadow: 0 18px 40px rgba(29, 29, 27, 0.08);
  padding: 28px 34px;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: -14px;
  z-index: -1;
  border: 1px solid rgba(211, 216, 221, 0.85);
  background:
    linear-gradient(90deg, rgba(250, 180, 0, 0.12), transparent 32%),
    rgba(255, 255, 255, 0.55);
}

.login-card__header {
  margin-bottom: 14px;
}

.login-card h1 {
  margin: 10px 0 8px;
  font-size: 26px;
  line-height: 1.22;
}

.login-notice {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-left: 3px solid var(--color-accent);
  background: #fff8df;
  color: #4b4b44;
  font-size: 13px;
  line-height: 1.4;
}

.login-notice a,
.login-card__link-row a {
  color: var(--color-primary);
}

.login-card__link-row {
  margin: 14px 0 0;
  font-size: 13px;
  text-align: center;
}

.login-card input,
.login-card .button {
  max-width: none;
}

/* Адаптив */
@media (max-width: 720px) {
  .page-header__inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 0;
  }

  .brand {
    width: 100%;
    gap: 12px;
  }

  .brand__logo {
    width: 158px;
    max-height: 56px;
  }

  .brand__organization {
    font-size: 19px;
    white-space: normal;
  }

  .brand__title {
    font-size: 14px;
    white-space: normal;
  }

  .control-panel {
    align-items: stretch;
    width: 100%;
  }

  .control-panel__body {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .control-panel__session {
    margin-left: 0;
    padding-top: 8px;
    padding-left: 0;
    border-top: 1px solid #c7d0dc;
    border-left: 0;
  }

  .grid--two,
  .grid--three {
    grid-template-columns: 1fr;
  }

  .file-documents-panel__top {
    flex-direction: column;
  }

  .file-documents-panel__actions {
    justify-content: flex-start;
  }

  .modal-overlay {
    padding: 12px;
  }

  .modal-card {
    padding: 14px;
  }

  .selection-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .selection-workspace__header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .selection-workspace__form {
    grid-column: auto;
  }

  .selection-workspace__form .selection-bar {
    flex-wrap: wrap;
  }

  .selection-parameters {
    width: 100%;
  }

  .data-freshness--compact {
    justify-content: flex-start;
    white-space: normal;
  }

  .selection-parameters__layout {
    grid-template-columns: 1fr;
  }

  .selection-inline-field {
    grid-template-columns: minmax(120px, 1fr) 76px;
  }

  .selection-inline-field--target {
    grid-template-columns: minmax(120px, 1fr) 64px;
  }

  .selection-parameter-section--drive {
    padding-left: 0;
    border-left: 0;
  }

.selection-parameters__action {
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
  }

  .selection-valve-columns {
    grid-template-columns: 1fr;
  }

  .selection-bar__button {
    width: 100%;
  }

  .selection-data-panel {
    width: 100%;
    flex-basis: auto;
  }

  .selection-view-panel {
    min-width: 0;
    width: 100%;
  }

  .selection-view-panel__controls {
    grid-template-columns: minmax(0, 1fr) 20px;
  }

  .selection-test-settings__controls {
    grid-template-columns: 1fr;
  }

  .selection-test-settings {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .selection-test-settings .selection-source-filter .selection-group-filter__menu {
    position: static;
    margin-top: 4px;
  }

  .selection-field,
  .selection-field--groups,
  .selection-extra-parameters__group .selection-group-filter {
    width: 100%;
  }

  .selection-highlight-toggle {
    justify-self: start;
  }

  .selection-highlight-control {
    justify-self: start;
  }

  .data-freshness {
    gap: 4px;
    white-space: normal;
  }

  .data-freshness__item + .data-freshness__item::before {
    content: none;
    margin: 0;
  }

  .activity-analysis-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    flex: 0 0 auto;
  }

  .activity-visits-layout {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .activity-users-scroll {
    max-height: 280px;
  }

  .activity-latest-scroll {
    max-height: clamp(320px, 52vh, 520px);
  }

  .activity-access-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deploy-control-panel {
    grid-template-columns: 1fr;
  }

  .settings-item {
    grid-template-columns: 1fr;
  }

  .deploy-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deploy-fact--remote {
    grid-column: 1 / -1;
  }

  .admin-deploy-panel__content {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .admin-deploy-actions {
    max-width: 320px;
  }

  .deploy-summary {
    grid-template-columns: 1fr;
  }

  .selection-field__control input {
    width: 100%;
  }

  .selection-field__control {
    width: 100%;
  }

  .summary-list__row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .page-footer {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 7px;
  }

  .developer-link {
    position: static;
    transform: none;
  }

  .login-page {
    min-height: 100%;
    padding: 24px 0;
  }

  .login-page::after {
    display: none;
  }

  .login-card {
    padding: 24px;
  }

  .login-card h1 {
    font-size: 22px;
  }
}
