:root {
  --sidebar-width: 320px;
  --bg: #ffffff;
  --bg-soft: #e8eaf0;
  --bg-soft-2: #d7e1fb;
  --line: #cfd8ee;
  --line-strong: #97ace6;
  --text: #050505;
  --muted: #5d6785;
  --brand: #3207ff;
  --brand-dark: #2812b1;
  --brand-deep: #0e0066;
  --danger: #bf1736;
  --radius: 26px;
  --radius-sm: 16px;
  --shadow: 0 24px 60px rgba(14, 0, 102, 0.08);
  --accent: #3207ff;

  /* Emoji icon button tokens */
  --emoji-icon-button-size: 46px;
  --emoji-icon-button-radius: 13px;
  --emoji-icon-button-bg: #FFFFFF;
  --emoji-icon-button-border: #C8D4F8;
  --emoji-icon-button-hover-bg: #F5F7FF;
  --emoji-icon-button-hover-border: #9FB4F5;
  --emoji-icon-button-active-bg: #EEF2FF;
  --emoji-icon-button-selected-bg: #243B8F;
  --emoji-icon-button-disabled-bg: #F3F5F9;
  --emoji-icon-button-disabled-border: #E1E6F0;
  --emoji-icon-button-danger-hover-bg: #FFF5F5;
  --emoji-icon-font-size: 22px;
  --emoji-icon-focus-ring: #1F4ED8;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  font-family: "TT Firs Neue", "TT Firs Neue Light", "Inter", "Segoe UI", sans-serif;
  background:
    linear-gradient(90deg, rgba(232, 234, 240, 0.58) 0, rgba(232, 234, 240, 0.58) var(--sidebar-width), transparent var(--sidebar-width)),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.layout--with-sidebar {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  min-width: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  isolation: isolate;
}

.sidebar-resize-handle {
  position: fixed;
  top: 22px;
  left: calc(var(--sidebar-width) - 7px);
  width: 14px;
  height: calc(100vh - 44px);
  border-radius: 999px;
  cursor: ew-resize;
  z-index: 80;
  transition: background-color 120ms ease;
}

.sidebar-resize-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-50%);
  background: rgba(151, 172, 230, 0.55);
}

.sidebar-resize-handle::after {
  content: "↔";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(50, 7, 255, 0.84);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(151, 172, 230, 0.8);
  box-shadow: 0 10px 20px rgba(14, 0, 102, 0.18);
  opacity: 0;
  transition: opacity 120ms ease, transform 120ms ease;
  pointer-events: none;
}

.sidebar-resize-handle:hover {
  background: rgba(151, 172, 230, 0.16);
}

.sidebar-resize-handle:hover::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.02);
}

body.is-resizing-sidebar,
body.is-resizing-sidebar * {
  cursor: ew-resize !important;
  user-select: none !important;
}

.sidebar-frame {
  min-width: 0;
  height: 100%;
  padding: 34px 24px 24px;
  background: linear-gradient(180deg, rgba(151, 172, 230, 0.52) 0%, rgba(232, 234, 240, 0.88) 38%, rgba(255, 255, 255, 0.96) 100%);
  border: 1px solid rgba(151, 172, 230, 0.65);
  border-radius: 34px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.brand {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
}

.sidebar-release {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(151, 172, 230, 0.45);
}

.sidebar-release__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-release__label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-release__sha {
  font-size: 0.92rem;
  font-weight: 600;
  font-family: "SFMono-Regular", Consolas, monospace;
  color: var(--brand);
}

.sidebar-release__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.sidebar-history-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  width: fit-content;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid rgba(151, 172, 230, 0.4);
  color: var(--brand);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.sidebar-history-link:hover {
  color: var(--brand-dark);
}

.sidebar-accent {
  display: none;
}

.nav {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.sidebar-search {
  display: grid;
  gap: 8px;
}

.sidebar-search__input {
  height: 54px;
  line-height: 54px;
  padding-top: 0;
  padding-bottom: 0;
}

.nav-tree {
  gap: 12px;
}

.nav-tree__group {
  min-height: 72px;
  flex: 0 0 auto;
  overflow: visible;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(151, 172, 230, 0.35);
  padding: 10px 10px 12px;
}

.nav-tree__group[open] {
  min-height: 0;
}

.nav-tree__summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  cursor: pointer;
  list-style: none;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 8px;
}

.nav-tree__group:not([open]) .nav-tree__summary {
  margin-bottom: 0;
}

.nav-tree__summary::-webkit-details-marker {
  display: none;
}

.nav-tree__items {
  display: grid;
  gap: 8px;
}

.nav-tree.is-searching {
  gap: 8px;
}

.nav-tree.is-searching .nav-tree__group {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.nav-tree.is-searching .nav-tree__summary {
  display: none;
}

.nav-tree__link {
  padding: 12px 14px;
  border-radius: 16px;
  color: rgba(5, 5, 5, 0.86);
  transition: transform 120ms ease, background 120ms ease, color 120ms ease;
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  line-height: 1.3;
}

.nav-tree__link:hover {
  background: rgba(255, 255, 255, 0.74);
  transform: translateX(2px);
}

.nav-tree__link.is-active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: white;
  box-shadow: 0 14px 28px rgba(50, 7, 255, 0.2);
}

.sidebar-user {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(151, 172, 230, 0.7);
}

.sidebar-user__name {
  font-size: 1.05rem;
}

.sidebar-user__role {
  margin-top: 4px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}

.sidebar-logout {
  margin-top: 14px;
  width: 100%;
}

.content {
  min-width: 0;
  padding: 26px 34px 40px;
}

.content-auth {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.page-header,
.hero-banner,
.auth-card,
.panel,
.metric-card {
  background: var(--bg);
  border: 1px solid rgba(151, 172, 230, 0.45);
  box-shadow: var(--shadow);
}

.page-header,
.hero-banner {
  position: relative;
  overflow: hidden;
  border-radius: 36px;
  padding: 16px 20px;
  margin-bottom: 20px;
  min-height: 110px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  width: 100%;
}

.page-header::before,
.hero-banner::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  right: 280px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  z-index: 0;
}

.page-header::after,
.hero-banner::after {
  display: none;
}

.page-header > *,
.hero-banner > * {
  position: relative;
  z-index: 1;
}

.page-header .hero-copy,
.hero-banner .hero-copy {
  align-self: end;
  color: white;
  padding: 4px 0;
}

.page-header .hero-copy .eyebrow,
.hero-banner .hero-copy .eyebrow {
  color: rgba(255, 255, 255, 0.84);
}

.hero-aside {
  display: block;
  align-self: end;
  justify-self: stretch;
  padding: 14px 16px 12px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 22px;
}

.hero-aside__label {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.hero-aside__meta {
  margin-top: 12px;
  font-size: 0.95rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  color: var(--brand);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

h1 {
  font-size: clamp(2.1rem, 4.6vw, 4rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.45rem;
  margin-bottom: 14px;
}

h3 {
  font-size: 1.14rem;
}

p {
  margin: 0;
}

.muted {
  color: var(--muted);
}

.auth-card {
  width: min(480px, 100%);
  border-radius: 32px;
  padding: 34px;
}

.auth-card h1 {
  font-size: 2.4rem;
  line-height: 1;
  margin: 10px 0 12px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.metric-card,
.panel {
  border-radius: 28px;
}

.metric-card {
  padding: 24px;
  min-height: 176px;
}

.metric-value {
  margin-top: 18px;
  font-size: 2.3rem;
  line-height: 1;
  color: var(--brand-deep);
}

.metric-detail {
  margin-top: 16px;
  color: var(--muted);
}

.metric-detail a {
  color: var(--brand);
}

.panel {
  padding: 24px;
  margin-bottom: 18px;
}

.dashboard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: -6px 0 18px;
}

.monitoring-summary {
  display: grid;
  gap: 16px;
}

.monitoring-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.monitoring-summary-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 18px;
  border: 3px dashed #354056;
  border-radius: 0;
  background: #fff;
  text-align: center;
}

.monitoring-summary-card ul {
  margin: 0;
  padding-left: 0;
  display: grid;
  gap: 6px;
  color: rgba(5, 5, 5, 0.82);
  line-height: 1.35;
  list-style: none;
}

.monitoring-summary-card h3 {
  white-space: pre-line;
  font-size: 1.2rem;
  line-height: 1.18;
  font-weight: 700;
}

.monitoring-summary-line {
  white-space: pre-line;
}

.monitoring-summary-line--accent,
.monitoring-summary-line--accent-inline {
  color: #c00000;
  font-weight: 800;
  font-size: 1.16rem;
}

.monitoring-summary-line--accent-inline {
  color: #050505;
}

.monitoring-summary-line--accent-inline::first-line {
  color: #c00000;
}

.monitoring-summary-line--italic {
  font-style: italic;
}

.vciom-mini-chart {
  display: grid;
  gap: 8px;
  width: min(100%, 700px);
  margin: 6px auto 0;
  text-align: left;
}

.vciom-mini-chart__row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(48px, 220px) minmax(48px, 72px) minmax(64px, 106px);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.vciom-mini-chart__row > * {
  min-width: 0;
}

.vciom-mini-chart__label {
  text-align: right;
  line-height: 1.15;
  color: rgba(5, 5, 5, 0.9);
  overflow-wrap: anywhere;
}

.vciom-mini-chart__track {
  position: relative;
  display: block;
  height: 28px;
  border-left: 2px solid rgba(93, 103, 133, 0.72);
  background: linear-gradient(90deg, rgba(151, 172, 230, 0.18), rgba(151, 172, 230, 0.04));
  border-radius: 0 8px 8px 0;
  overflow: hidden;
}

.vciom-mini-chart__bar {
  display: block;
  height: 100%;
  width: calc(clamp(0, var(--bar-value, 0), 100) * 1%);
  min-width: 8px;
  border: 1px solid rgba(5, 5, 5, 0.24);
  border-left: 0;
}

.vciom-mini-chart__value {
  display: block;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.05;
}

.vciom-mini-chart__delta {
  font-style: italic;
  color: rgba(5, 5, 5, 0.86);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.05;
}

.summary-edit-list {
  display: grid;
  gap: 14px;
}

.summary-edit-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(151, 172, 230, 0.7);
  border-radius: 16px;
}

.summary-edit-card legend {
  padding: 0 8px;
  color: var(--brand);
  font-weight: 700;
}

.summary-edit-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
  gap: 10px;
  align-items: start;
}

.summary-edit-line--new {
  opacity: 0.78;
}

.vciom-edit-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 110px minmax(120px, 160px) 64px;
  gap: 10px;
  align-items: center;
}

.monitoring-section-heading {
  display: grid;
  gap: 6px;
  margin: 28px 0 14px;
  padding: 0 4px;
}

.monitoring-section-heading h2 {
  margin-bottom: 0;
  color: var(--brand-deep);
}

.monitoring-section-heading p,
.chart-source-note {
  color: var(--muted);
  line-height: 1.4;
}

.chart-source-note {
  margin: -4px 0 14px;
  font-size: 0.92rem;
}

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

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

.panel-filter {
  padding: 18px 24px;
}

.filter-form,
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.filter-form label,
.inline-form label {
  min-width: 180px;
}

.filter-form__error {
  width: 100%;
}

.stack,
.form-grid,
label {
  display: grid;
  gap: 8px;
}

.form-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(151, 172, 230, 0.75);
  background: #fff;
  color: var(--text);
}

input[type="checkbox"] {
  width: auto;
}

.data-editor-table {
  min-width: 720px;
}

.data-editor-table th,
.data-editor-table td {
  min-width: 140px;
  padding: 6px;
}

.data-editor-table input,
.data-editor-table select,
.data-editor-table textarea {
  min-width: 120px;
  padding: 8px 10px;
  border-radius: 8px;
}

.flatpickr-calendar {
  border-radius: 18px;
  border: 1px solid rgba(151, 172, 230, 0.7);
  box-shadow: 0 18px 45px rgba(32, 40, 69, 0.16);
  overflow: hidden;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover,
.flatpickr-day.prevMonthDay.flatpickr-disabled,
.flatpickr-day.nextMonthDay.flatpickr-disabled {
  color: rgba(93, 103, 133, 0.32);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(50, 7, 255, 0.18);
  border-color: var(--brand);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: white;
  cursor: pointer;
}

.button.ghost {
  background: white;
  color: var(--text);
  border-color: rgba(151, 172, 230, 0.8);
}

.button.danger {
  background: var(--danger);
}

.button.small {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.9rem;
}

/* ============================================================
   Emoji Icon Button — единая система emoji-иконок для дашборда
   ============================================================ */

.emoji-icon-button,
button.emoji-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--emoji-icon-button-size);
  height: var(--emoji-icon-button-size);
  min-width: var(--emoji-icon-button-size);
  min-height: var(--emoji-icon-button-size);
  padding: 1px 0 0 0;
  border: 1px solid var(--emoji-icon-button-border);
  border-radius: var(--emoji-icon-button-radius);
  background: var(--emoji-icon-button-bg);
  color: var(--text);
  font-size: var(--emoji-icon-font-size) !important;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 100ms ease;
  position: relative;
}

.emoji-icon-button:hover:not(:disabled) {
  background: var(--emoji-icon-button-hover-bg);
  border-color: var(--emoji-icon-button-hover-border);
}

.emoji-icon-button:active:not(:disabled) {
  background: var(--emoji-icon-button-active-bg);
  transform: scale(0.96);
}

.emoji-icon-button:focus-visible {
  outline: 2px solid var(--emoji-icon-focus-ring);
  outline-offset: 2px;
}

.emoji-icon-button.is-active,
.emoji-icon-button[aria-pressed="true"] {
  background: var(--emoji-icon-button-selected-bg);
  border-color: var(--emoji-icon-button-selected-bg);
  color: #FFFFFF;
}

.emoji-icon-button.is-active:hover:not(:disabled),
.emoji-icon-button[aria-pressed="true"]:hover:not(:disabled) {
  background: var(--emoji-icon-button-selected-bg);
  border-color: var(--emoji-icon-button-selected-bg);
  filter: brightness(1.12);
}

.emoji-icon-button:disabled {
  background: var(--emoji-icon-button-disabled-bg);
  border-color: var(--emoji-icon-button-disabled-border);
  color: var(--muted);
  opacity: 0.55;
  cursor: not-allowed;
}

.emoji-icon-button.emoji-icon-button--danger:hover:not(:disabled) {
  background: var(--emoji-icon-button-danger-hover-bg);
  border-color: var(--danger);
}

.emoji-icon-button.emoji-icon-button--subtle {
  background: transparent;
  border-color: transparent;
}

.emoji-icon-button.emoji-icon-button--subtle:hover:not(:disabled) {
  background: var(--emoji-icon-button-hover-bg);
  border-color: var(--emoji-icon-button-hover-border);
}

/* Совместимость со старым классом — постепенно заменить на emoji-icon-button */
.button.small.icon-only {
  width: var(--emoji-icon-button-size);
  min-width: var(--emoji-icon-button-size);
  min-height: var(--emoji-icon-button-size);
  padding: 1px 0 0 0;
  font-size: var(--emoji-icon-font-size) !important;
  font-weight: 400;
  line-height: 1;
  border-radius: var(--emoji-icon-button-radius);
}

.search-field {
  display: grid;
  gap: 8px;
  min-width: min(320px, 100%);
}

.search-field__label {
  color: var(--muted);
  font-size: 0.9rem;
}

.search-field--compact {
  min-width: min(260px, 100%);
}

.toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
}

.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  position: relative;
}

.chart-toolbar__right {
  margin-left: auto;
  display: grid;
  justify-items: end;
  gap: 6px;
}

.chart-toolbar__meta {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.2;
  text-align: right;
}

.chart-toolbar__actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.chart-toolbar__toggles {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.icon-button {
  min-width: 42px;
  padding-inline: 12px;
}

.chart-toolbar__actions .button.is-active,
.chart-toolbar__actions .emoji-icon-button.is-active {
  background: var(--emoji-icon-button-selected-bg);
  color: #fff;
  border-color: var(--emoji-icon-button-selected-bg);
}

.chart-settings-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  display: none;
  min-width: 320px;
  max-width: min(92vw, 420px);
  max-height: min(72vh, 560px);
  overflow-y: auto;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(151, 172, 230, 0.7);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 45px rgba(32, 40, 69, 0.16);
  z-index: 20;
}

.chart-settings-popover.is-open {
  display: grid;
  gap: 10px;
}

.chart-settings-popover__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand);
}

.chart-settings-popover__description {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.chart-settings-popover__subtitle {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chart-settings-popover__status {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(232, 234, 240, 0.62);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.chart-settings-popover__series {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.chart-settings-popover__row {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  line-height: 1.25;
}

.chart-settings-popover__row span {
  overflow-wrap: anywhere;
}

.chart-settings-popover__row--strong {
  font-weight: 700;
}

.chart-note-flags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.chart-note-flag {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 10px;
  border: 1px solid rgba(191, 23, 54, 0.35);
  background: rgba(191, 23, 54, 0.08);
  color: var(--danger);
  cursor: pointer;
  font-size: 0.86rem;
}

.chart-note-flag.is-dimmed {
  opacity: 0.42;
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.08);
  color: var(--muted);
}

.chart-settings-card {
  padding: 18px 0 0;
  border-top: 1px solid rgba(207, 216, 238, 0.9);
}

.chart-settings-card:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.chart-settings-card--nested > summary {
  cursor: pointer;
  list-style: none;
}

.chart-settings-card--nested > summary::-webkit-details-marker {
  display: none;
}

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

.chart-settings-card__header--axis {
  flex-wrap: wrap;
}

.axis-fields {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.axis-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.8rem;
  color: var(--muted);
}

.axis-field span {
  font-weight: 600;
}

.input--small {
  width: 90px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 0.85rem;
}

.chart-legend-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(151, 172, 230, 0.75);
  font-size: 1.05rem;
  background: #fff;
  color: var(--text);
}

.chart-legend-input:focus {
  outline: 2px solid rgba(50, 7, 255, 0.18);
  border-color: var(--brand);
}

.chart-color-cell {
  width: 110px;
}

.chart-color-input {
  width: 64px;
  height: 42px;
  padding: 4px;
  border-radius: 10px;
}

.chart-color-code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.92rem;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.dashboard-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-card-group {
  margin-bottom: 22px;
}

.dashboard-card-group h2 {
  margin-bottom: 12px;
}

.dashboard-card-group.is-sortable h2 {
  cursor: grab;
}

.dashboard-card-group.is-sortable.is-dragging {
  opacity: 0.72;
}

.dashboard-card-group.is-searching h2 {
  display: none;
}

.release-history-grid {
  display: grid;
  gap: 16px;
}

.release-card {
  display: grid;
  gap: 12px;
  margin-bottom: 0;
}

.release-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.92rem;
}

.release-card__head strong {
  color: var(--brand);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.release-card h2 {
  font-size: clamp(1.05rem, 1vw + 0.85rem, 1.45rem);
  line-height: 1.22;
}

.release-card__details {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.dashboard-card {
  display: grid;
  gap: 14px;
  min-height: 176px;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(151, 172, 230, 0.45);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(232, 234, 240, 0.62) 100%);
  box-shadow: var(--shadow);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.dashboard-card[draggable="true"] {
  cursor: grab;
}

.dashboard-card.is-dragging {
  opacity: 0.55;
  transform: scale(0.98);
}

.is-saving-dashboard-order .dashboard-card[draggable="true"],
.is-saving-dashboard-order .dashboard-card-group.is-sortable h2 {
  cursor: wait;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  border-color: rgba(50, 7, 255, 0.38);
  box-shadow: 0 26px 58px rgba(14, 0, 102, 0.12);
}

.dashboard-card.is-dragging:hover {
  transform: scale(0.98);
}

.dashboard-card h3 {
  font-size: 1.42rem;
  line-height: 1.02;
}

.dashboard-card__description {
  color: rgba(5, 5, 5, 0.82);
  line-height: 1.38;
}

.dashboard-card__footer {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(151, 172, 230, 0.5);
}

.dashboard-card__label {
  color: var(--muted);
  font-size: 0.9rem;
}

.table-export-toolbar {
  align-items: end;
  justify-content: flex-end;
  position: relative;
}

.table-column-popover {
  top: calc(100% + 8px);
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
}

.note-chip {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(151, 172, 230, 0.55);
  background: linear-gradient(180deg, rgba(232, 234, 240, 0.4) 0%, white 100%);
}

.note-chip-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.note-chip-wrapper .note-chip {
  flex: 1;
}

.note-chip__date {
  display: block;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
  color: var(--brand);
  margin-bottom: 4px;
}

.note-chip__text {
  display: block;
  line-height: 1.45;
}

.note-chip__delete-form {
  flex-shrink: 0;
  padding-top: 8px;
}

.notes-edit-list {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note-edit-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.note-edit-row--new {
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

.input--date {
  width: 100%;
  min-width: 0;
}

.input--text {
  min-width: 0;
}

.table-wrap {
  overflow-x: auto;
}

.collapsible-panel summary {
  cursor: pointer;
  list-style: none;
  font-size: 1.45rem;
  margin-bottom: 16px;
}

.collapsible-panel summary::-webkit-details-marker {
  display: none;
}

.collapsible-panel summary::after {
  content: "Развернуть";
  margin-left: 12px;
  font-size: 0.95rem;
  color: var(--muted);
}

.collapsible-panel[open] summary::after {
  content: "Свернуть";
}

.collapsible-panel.is-loading {
  position: relative;
}

.collapsible-panel.is-loading::before {
  content: "";
  position: absolute;
  right: 22px;
  top: 22px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(151, 172, 230, 0.45);
  border-top-color: var(--accent);
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.nested-panel {
  margin-top: 18px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(194, 208, 245, 0.7);
  box-shadow: none;
}

table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(207, 216, 238, 0.9);
  vertical-align: top;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.sortable-th {
  cursor: pointer;
  user-select: none;
}

.draggable-th {
  position: relative;
  padding-right: 22px;
}

.draggable-th.drag-over {
  outline: 2px dashed rgba(50, 7, 255, 0.35);
  outline-offset: -6px;
  border-radius: 12px;
}

.draggable-th.is-dragging {
  opacity: 0.5;
}

.sortable-th::after {
  content: " ↕";
  color: rgba(93, 103, 133, 0.55);
}

.column-resize-handle {
  position: absolute;
  top: 8px;
  right: 3px;
  bottom: 8px;
  width: 8px;
  cursor: col-resize;
  border-right: 2px solid rgba(151, 172, 230, 0.5);
}

.column-resize-handle:hover {
  border-right-color: var(--accent);
}

.sortable-th.is-sorted-asc::after {
  content: " ↑";
  color: var(--accent);
}

.sortable-th.is-sorted-desc::after {
  content: " ↓";
  color: var(--accent);
}

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

.contract-data-editor-table__actions {
  width: 220px;
  min-width: 220px;
  white-space: nowrap;
}

.contract-data-editor-table .table-actions {
  flex-wrap: nowrap;
  align-items: center;
}

.contract-data-editor-table .table-actions form {
  margin: 0;
  flex: 0 0 auto;
}

tr:last-child td {
  border-bottom: 0;
}

.alert {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(191, 23, 54, 0.08);
  color: var(--danger);
}

.section-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.section-actions--right {
  justify-content: flex-end;
}

.inline-edit-panel {
  width: 100%;
  max-width: none;
  border: 1px solid rgba(151, 172, 230, 0.55);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.78);
}

.inline-edit-panel summary {
  cursor: pointer;
  list-style: none;
  color: var(--brand);
  font-weight: 600;
}

.inline-edit-panel summary::-webkit-details-marker {
  display: none;
}

.inline-edit-panel[open] {
  display: grid;
  gap: 12px;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.original-value {
  margin-top: 5px;
  color: var(--danger);
  font-size: 0.78rem;
}

.payload-preview {
  white-space: pre-wrap;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(232, 234, 240, 0.55);
  border: 1px solid rgba(151, 172, 230, 0.45);
}

canvas {
  width: 100%;
  min-height: 360px;
  max-height: 520px;
}

.chart-range-brush {
  position: relative;
  width: 100%;
  height: 32px;
  margin: 12px 0 4px;
  border: 1px solid rgba(151, 172, 230, 0.62);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 247, 255, 0.86)),
    rgba(232, 234, 240, 0.44);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

.chart-range-brush.is-dragging {
  cursor: grabbing;
}

.chart-range-brush__overview,
.chart-range-brush__shade,
.chart-range-brush__window {
  position: absolute;
  inset-block: 0;
  pointer-events: none;
}

.chart-range-brush__overview {
  inset-inline: 0;
  width: 100%;
  height: 100%;
}

.chart-range-brush__shade {
  background: rgba(232, 234, 240, 0.58);
  backdrop-filter: saturate(0.9);
}

.chart-range-brush__shade--start {
  left: 0;
}

.chart-range-brush__shade--end {
  right: 0;
}

.chart-range-brush__window {
  top: 4px;
  bottom: 4px;
  border: 1px solid rgba(50, 7, 255, 0.62);
  border-radius: 9px;
  background: rgba(50, 7, 255, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.62),
    0 10px 24px rgba(14, 0, 102, 0.1);
}

.chart-range-brush__handle {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(50, 7, 255, 0.58);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(14, 0, 102, 0.14);
  transform: translate(-50%, -50%);
  cursor: ew-resize;
  z-index: 2;
}

.chart-range-brush__handle::before {
  content: "";
  position: absolute;
  inset: 7px 5px;
  border-left: 1px solid rgba(50, 7, 255, 0.58);
  border-right: 1px solid rgba(50, 7, 255, 0.58);
}

.chart-range-brush__handle:hover,
.chart-range-brush__handle:focus-visible {
  border-color: var(--brand);
  outline: none;
  box-shadow:
    0 0 0 3px rgba(50, 7, 255, 0.14),
    0 10px 22px rgba(14, 0, 102, 0.18);
}

.chart-range-brush.is-full-range .chart-range-brush__window {
  border-color: rgba(151, 172, 230, 0.72);
  background: rgba(151, 172, 230, 0.1);
}

.service-check-board {
  padding: 10px 12px 0;
}

.service-check-board__header,
.service-check-board__footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.service-check-board__header h1 {
  font-size: clamp(2.8rem, 4.2vw, 4rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.service-check-board__header h1 span {
  color: var(--brand);
}

.service-check-board__meta {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--text);
  font-size: 1.05rem;
  font-style: italic;
  padding-top: 14px;
}

.service-check-board__mark {
  width: 40px;
  height: 40px;
}

.service-check-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  margin-top: 8px;
}

.service-check-mobile {
  display: none;
}

.service-check-column--right {
  border-left: 1px solid rgba(5, 5, 5, 0.25);
  padding-left: 28px;
}

.service-check-group {
  margin-bottom: 14px;
}

.service-check-group summary,
.service-check-mobile-group summary {
  cursor: pointer;
  list-style: none;
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.service-check-group summary::-webkit-details-marker,
.service-check-mobile-group summary::-webkit-details-marker {
  display: none;
}

.service-check-group summary::after,
.service-check-mobile-group summary::after {
  content: "Свернуть";
  margin-left: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.service-check-group:not([open]) summary::after,
.service-check-mobile-group:not([open]) summary::after {
  content: "Развернуть";
}

.service-check-table {
  min-width: 0;
  table-layout: fixed;
}

.service-check-col--service {
  width: 60%;
}

.service-check-col--status {
  width: 13.33%;
}

.service-check-col--actions {
  width: 160px;
}

.service-check-table th {
  color: var(--brand);
  font-size: 1.02rem;
  font-weight: 600;
  padding: 0 8px 8px 0;
  border-bottom: 3px solid var(--brand);
}

.service-check-table td {
  padding: 8px 8px 8px 0;
  font-size: 0.98rem;
  border-bottom: 1px solid rgba(5, 5, 5, 0.18);
  vertical-align: middle;
}

.service-check-service {
  overflow-wrap: anywhere;
}

.service-check-status-cell,
.service-check-table th:nth-child(2),
.service-check-table th:nth-child(3),
.service-check-table th:nth-child(4) {
  text-align: center;
}

.service-check-status-cell {
  padding-right: 0;
}

.service-check-side-panel {
  margin-bottom: 14px;
}

.service-check-table--editable input,
.service-check-table--editable select {
  width: 100%;
  min-height: 34px;
}

.service-check-edit-status-preview {
  margin-bottom: 4px;
}

.service-check-actions {
  white-space: nowrap;
}

.service-check-table--editable .table-actions {
  flex-wrap: nowrap;
}

.service-status-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  width: 100%;
}

.service-status {
  display: flex;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  margin: 0 auto;
}

.service-status--blocked {
  background: #10b14c;
}

.service-status--partial {
  background: #ffb612;
}

.service-status--not-detected {
  background: #d40000;
}

.service-status--none {
  width: 18px;
  height: 18px;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  align-items: center;
  justify-content: center;
}

.service-check-summary {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.service-check-summary__box,
.service-check-averages {
  background: rgba(215, 225, 251, 0.72);
  padding: 16px 18px;
}

.service-check-summary__headline,
.service-check-summary__line,
.service-check-averages__row,
.service-check-averages__head {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.22;
}

.service-check-summary__headline {
  color: var(--brand);
  margin-bottom: 6px;
}

.service-check-summary__line.is-blocked {
  color: #10b14c;
}

.service-check-summary__line.is-partial {
  color: #ffb612;
}

.service-check-summary__line.is-not_detected {
  color: #d40000;
}

.service-check-legend--inline {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(151, 172, 230, 0.45);
}

.service-check-averages__head,
.service-check-averages__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 92px 92px;
  gap: 10px;
  align-items: baseline;
}

.service-check-averages__head {
  color: var(--brand);
  margin-bottom: 8px;
}

.service-check-averages__row {
  color: var(--brand);
  margin-top: 8px;
}

.service-check-board__footer {
  align-items: flex-end;
  margin-top: 22px;
  padding-bottom: 8px;
}

.service-check-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
}

.service-check-legend--under-board {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(151, 172, 230, 0.45);
  background: rgba(255, 255, 255, 0.72);
}

.service-check-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.98rem;
}

/* ============================================================
   Contract Status Board — enterprise dashboard table
   ============================================================ */

.contract-board {
  padding: 0;
}

.contract-board__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.contract-board__header h1 {
  font-size: clamp(2.7rem, 4.4vw, 4rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

.contract-board__header h1 span {
  color: var(--brand);
}

.contract-board__mark {
  width: 40px;
  height: 40px;
}

.contract-board__table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px;
  border: 1px solid rgba(151, 172, 230, 0.35);
}

.contract-board__table {
  min-width: 920px;
  table-layout: fixed;
  border-collapse: collapse;
}

.contract-board__mobile {
  display: none;
}

/* --- Table header --- */
.contract-board__table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(135deg, #2d1b9e 0%, #4c35d4 100%);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  padding: 15px 12px;
  border-bottom: 0;
  letter-spacing: 0.02em;
}

.contract-board__table thead th:first-child {
  border-radius: 18px 0 0 0;
}

.contract-board__table thead th:last-child {
  border-radius: 0 18px 0 0;
}

/* --- Table body --- */
.contract-board__table tbody td {
  font-size: 0.94rem;
  line-height: 1.35;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(207, 216, 238, 0.65);
  vertical-align: middle;
  background: #fff;
  transition: background 120ms ease;
}

/* --- Row striping --- */
.contract-board__table tbody tr:nth-child(even) td {
  background: #F8FAFF;
}

.contract-board__table tbody tr:hover td {
  background: #F3F5FF;
}

/* --- Column widths & alignment --- */
.contract-board__table td:nth-child(1) {
  width: 27%;
  font-weight: 700;
  text-align: left;
  color: var(--text);
}

.contract-board__table th:nth-child(1) {
  width: 27%;
  text-align: left;
  color: #fff;
}

.contract-board__table th:nth-child(2),
.contract-board__table td:nth-child(2),
.contract-board__table th:nth-child(3),
.contract-board__table td:nth-child(3),
.contract-board__table th:nth-child(4),
.contract-board__table td:nth-child(4) {
  width: 13%;
  text-align: center;
}

.contract-board__table th:nth-child(5),
.contract-board__table td:nth-child(5) {
  width: 17%;
  text-align: center;
}

.contract-board__table th:nth-child(6),
.contract-board__table td:nth-child(6),
.contract-board__table th:nth-child(7),
.contract-board__table td:nth-child(7) {
  width: 8.5%;
  text-align: center;
}

/* --- Free funds highlight (amber accent, not whole-row) --- */
.contract-cell--funds {
  background: #FFF8E1 !important;
  font-weight: 600;
  color: #B45309;
  border-radius: 0;
}

.contract-board__table tbody tr:nth-child(even) td.contract-cell--funds {
  background: #FFF3D6 !important;
}

.contract-board__table tbody tr:hover td.contract-cell--funds {
  background: #FFEDC2 !important;
}

/* --- Status badge system --- */
.status-badge {
  display: inline-block;
  max-width: 100%;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  letter-spacing: 0.02em;
}

.status-badge--success {
  background: #E6F7ED;
  color: #1B7F4A;
  border: 1px solid rgba(27, 127, 74, 0.25);
}

.status-badge--info {
  background: #E8F0FE;
  color: #1A56B8;
  border: 1px solid rgba(26, 86, 184, 0.25);
}

.status-badge--warning {
  background: #FFF3E0;
  color: #B85C1A;
  border: 1px solid rgba(184, 92, 26, 0.25);
}

.status-badge--danger {
  background: #FDEAEA;
  color: #B91C1C;
  border: 1px solid rgba(185, 28, 28, 0.25);
}

.status-badge--neutral {
  background: #F1F3F8;
  color: #6B7280;
  border: 1px solid rgba(107, 114, 128, 0.2);
}

/* --- Footnotes --- */
.contract-board__footnote {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 12px 0 2px;
  padding: 10px 16px;
  background: rgba(232, 234, 240, 0.42);
  border-radius: 14px;
  border: 1px solid rgba(151, 172, 230, 0.3);
}

/* --- Table footer --- */
.contract-board__table tfoot td {
  background: rgba(248, 250, 255, 0.96);
  font-weight: 700;
  font-size: 0.96rem;
  border-top: 2px solid rgba(151, 172, 230, 0.7);
  border-bottom: 0;
}

.contract-total-table-row td:first-child {
  text-align: center;
  font-weight: 700;
}

.contract-total-table-row--percent td {
  border-top: 1px solid rgba(151, 172, 230, 0.5);
  font-weight: 600;
  color: var(--brand);
}

/* --- Panel subheading --- */
.panel-subtitle {
  color: var(--muted);
  font-size: 0.92rem;
  margin: -8px 0 18px;
  line-height: 1.4;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 1200px) {
  .page-header,
  .hero-banner {
    width: 100%;
  }

  .page-header::before,
  .hero-banner::before {
    right: 280px;
  }

  .hero-aside {
    display: block;
  }
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar-resize-handle {
    display: none;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 18px 18px 0;
  }

  body {
    background:
      linear-gradient(180deg, rgba(232, 234, 240, 0.58) 0, rgba(232, 234, 240, 0.58) 420px, transparent 420px),
      var(--bg);
  }

  .content {
    padding: 18px;
  }

  .sidebar-frame {
    gap: 18px;
    padding: 24px 18px 18px;
  }

  .nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 2px 8px;
    margin: 0 -2px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .nav-tree__group {
    flex: 0 0 auto;
    min-width: 220px;
  }

  .nav a {
    flex: 0 0 auto;
    min-width: max-content;
    white-space: nowrap;
  }

  .sidebar-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
  }

  .sidebar-user form {
    margin-left: auto;
  }

  .sidebar-logout {
    width: auto;
    min-width: 132px;
    margin-top: 0;
  }

  .page-header,
  .hero-banner {
    grid-template-columns: 1fr;
    padding: 18px;
    min-height: 0;
  }

  .page-header::before,
  .hero-banner::before {
    right: 0;
    bottom: 42%;
  }

  .page-header .hero-copy,
  .hero-banner .hero-copy {
    padding: 2px 0 0;
  }

  .hero-aside {
    align-self: stretch;
    justify-self: stretch;
  }

  .panel,
  .metric-card {
    padding: 20px;
  }

  .panel-filter {
    padding: 18px 20px;
  }

  .filter-form label,
  .inline-form label {
    min-width: 0;
  }

  canvas {
    min-height: 300px;
  }

  table {
    min-width: 720px;
  }

  .service-check-board {
    padding: 0;
  }

  .service-check-board__header h1,
  .contract-board__header h1 {
    line-height: 0.98;
  }

  .service-check-grid {
    gap: 22px;
  }

  .service-check-column--right {
    padding-left: 22px;
  }

  .service-check-summary__box,
  .service-check-averages {
    padding: 16px 18px;
  }

  .contract-board {
    padding: 0;
  }

  .contract-board__table {
    min-width: 920px;
  }

  .contract-board__table td,
  .contract-board__table th {
    padding-left: 10px;
    padding-right: 10px;
  }

  .contract-total-row {
    grid-template-columns: 27% minmax(80px, 13%) minmax(80px, 13%) minmax(80px, 13%);
  }
}

@media (max-width: 820px) {
  .content {
    padding: 14px;
  }

  .page-header,
  .hero-banner {
    border-radius: 28px;
    margin-bottom: 16px;
  }

  .page-header .hero-copy,
  .hero-banner .hero-copy {
    display: grid;
    gap: 8px;
  }

  .hero-aside {
    padding: 12px 14px;
    border-radius: 18px;
  }

  .cards-grid,
  .notes-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .note-edit-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .chart-toolbar,
  .panel-heading,
  .section-actions {
    align-items: stretch;
  }

  .chart-toolbar,
  .panel-heading {
    flex-direction: column;
  }

  .chart-toolbar > *,
  .panel-heading > * {
    width: 100%;
  }

  .chart-toolbar__actions {
    width: 100%;
  }

  .chart-toolbar__right {
    justify-items: stretch;
  }

  .chart-toolbar__meta {
    text-align: left;
  }

  .chart-toolbar__actions .button {
    flex: 1 1 180px;
  }

  .dashboard-actions {
    justify-content: stretch;
  }

  .dashboard-actions .button {
    width: 100%;
  }

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

  .summary-edit-line,
  .vciom-edit-grid {
    grid-template-columns: 1fr;
  }

  .vciom-mini-chart__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .vciom-mini-chart__label {
    text-align: left;
  }

  .vciom-mini-chart__value {
    text-align: left;
  }

  .table-export-toolbar {
    flex-direction: column;
  }

  .search-field,
  .search-field--compact {
    min-width: 100%;
  }

  .metric-card {
    min-height: 0;
  }

  .metric-value {
    margin-top: 12px;
    font-size: 2rem;
  }

  .service-check-grid {
    grid-template-columns: 1fr;
  }

  .service-check-column--right {
    border-left: 0;
    padding-left: 0;
  }

  .service-check-board__header,
  .service-check-board__footer,
  .contract-board__header {
    flex-direction: column;
  }

  .service-check-board__meta {
    padding-top: 0;
  }

  .service-check-table {
    table-layout: auto;
  }

  .service-check-table th {
    font-size: 1rem;
    padding-bottom: 8px;
  }

  .service-check-table td {
    font-size: 0.96rem;
    padding: 8px 8px 8px 0;
  }

  .service-check-category {
    width: 30%;
    font-size: 0.98rem;
    padding-right: 12px;
  }

  .service-check-summary {
    gap: 12px;
  }

  .service-check-legend {
    gap: 8px 16px;
  }

  .service-check-legend__item {
    font-size: 0.92rem;
  }

  .service-check-board__page {
    align-self: flex-end;
  }

  canvas {
    min-height: 260px;
    max-height: 420px;
  }

  table {
    min-width: 640px;
  }
}

@media (max-width: 680px) {
  .page-header,
  .hero-banner,
  .auth-card,
  .panel,
  .metric-card,
  .sidebar-frame {
    border-radius: 24px;
  }

  .page-header,
  .hero-banner {
    padding: 16px;
    min-height: 0;
    width: 100%;
    grid-template-columns: 1fr;
  }

  .page-header::after,
  .hero-banner::after {
    display: none;
  }

  .page-header::before,
  .hero-banner::before {
    right: 0;
  }

  .hero-aside {
    margin-top: 2px;
  }

  .page-header .hero-copy,
  .hero-banner .hero-copy {
    padding-top: 0;
  }

  h1 {
    font-size: 1.95rem;
    line-height: 1;
  }

  .filter-form,
  .inline-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .filter-form .button,
  .inline-form .button,
  .section-actions .button,
  .section-actions form,
  .panel-heading .button {
    width: 100%;
  }

  .button {
    min-height: 46px;
  }

  .content-auth {
    padding: 16px;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .sidebar {
    padding: 12px 12px 0;
  }

  .sidebar-frame {
    padding: 16px 14px 14px;
    gap: 14px;
  }

  .brand {
    width: auto;
    max-width: 100%;
  }

  .brand-logo {
    width: min(100%, 220px);
    max-width: min(100%, 220px);
  }

  .nav {
    gap: 8px;
    padding-bottom: 6px;
  }

  .nav-tree__group {
    min-width: 200px;
  }

  .nav a {
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 0.94rem;
  }

  .sidebar-user {
    display: grid;
    gap: 8px;
  }

  .sidebar-user form {
    margin-left: 0;
  }

  .sidebar-logout {
    width: 100%;
  }

  .dashboard-card {
    min-height: 0;
    padding: 18px;
    border-radius: 24px;
  }

  .panel,
  .metric-card {
    padding: 16px;
  }

  .panel-filter {
    padding: 16px;
  }

  .chart-toolbar {
    margin-bottom: 10px;
  }

  .service-check-grid--desktop,
  .service-check-legend--under-board,
  .contract-board__table-wrap,
  .contract-board__totals {
    display: none;
  }

  .service-check-mobile,
  .contract-board__mobile {
    display: grid;
    gap: 14px;
  }

  .service-check-mobile-group {
    display: grid;
    gap: 10px;
  }

  .service-check-mobile-group h3 {
    font-size: 1.05rem;
    color: var(--brand);
  }

  .service-check-mobile-list {
    display: grid;
    gap: 10px;
  }

  .service-check-mobile-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(151, 172, 230, 0.5);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(232, 234, 240, 0.5) 100%);
  }

  .service-check-mobile-card__service {
    font-weight: 700;
  }

  .service-check-mobile-card__statuses {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .service-check-mobile-status {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 10px 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(151, 172, 230, 0.35);
    text-align: center;
  }

  .service-check-mobile-status span {
    color: var(--muted);
    font-size: 0.76rem;
  }

  .service-check-board__footer--mobile {
    margin-top: 4px;
  }

  .service-status-wrap {
    min-height: 20px;
  }

  .service-status {
    width: 16px;
    height: 16px;
  }

  .service-status--none {
    width: 16px;
    height: 16px;
    font-size: 1rem;
  }

  .service-check-averages__head,
  .service-check-averages__row {
    grid-template-columns: minmax(0, 1fr) repeat(3, minmax(52px, 1fr));
    font-size: 0.88rem;
  }

  .contract-mobile-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(151, 172, 230, 0.45);
    background: #fff;
    box-shadow: 0 1px 3px rgba(14, 0, 102, 0.04);
  }

  .contract-mobile-card h3 {
    color: var(--brand);
    font-size: 1.05rem;
    font-weight: 700;
  }

  .contract-mobile-card--success {
    border-left: 4px solid #1B7F4A;
    background: #fff;
  }

  .contract-mobile-card--warning {
    border-left: 4px solid #B85C1A;
    background: #fff;
  }

  .contract-mobile-card--danger {
    border-left: 4px solid #B91C1C;
    background: #fff;
  }

  .contract-mobile-card--continuation {
    border-left: 4px solid var(--line-strong);
    background: #fff;
  }

  .contract-mobile-card--totals {
    background: linear-gradient(135deg, #F8FAFF 0%, #EEF2FF 100%);
    border: 1px solid rgba(151, 172, 230, 0.55);
  }

  .contract-mobile-card__grid {
    display: grid;
    gap: 10px;
  }

  .contract-mobile-card__item {
    display: grid;
    gap: 4px;
  }

  .contract-mobile-card__item span {
    color: rgba(5, 5, 5, 0.65);
    font-size: 0.8rem;
  }

  .contract-mobile-card__item strong {
    font-size: 0.98rem;
    line-height: 1.25;
  }

  .contract-total-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
  }

  .contract-board__footnote {
    margin-left: 0;
  }

  .contract-board__footnote--mobile {
    margin: 0;
    font-size: 0.92rem;
  }

  .contract-board__table th,
  .contract-board__table td {
    font-size: 0.86rem;
    padding: 10px 8px;
  }

  .contract-board__table thead th:first-child {
    border-radius: 14px 0 0 0;
  }

  .contract-board__table thead th:last-child {
    border-radius: 0 14px 0 0;
  }

  .contract-board__table-wrap {
    border-radius: 14px;
  }

  table {
    min-width: 560px;
  }

  .chart-toolbar__actions .button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  body {
    background:
      linear-gradient(180deg, rgba(232, 234, 240, 0.58) 0, rgba(232, 234, 240, 0.58) 300px, transparent 300px),
      var(--bg);
  }

  .content {
    padding: 10px;
  }

  .page-header,
  .hero-banner {
    padding: 14px;
    border-radius: 20px;
  }

  .page-header::before,
  .hero-banner::before {
    bottom: 46%;
  }

  .hero-aside {
    padding: 12px;
    border-radius: 16px;
  }

  .eyebrow {
    font-size: 0.7rem;
  }

  h1 {
    font-size: 1.72rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  .metric-value {
    font-size: 1.72rem;
  }

  .dashboard-card {
    padding: 16px;
  }

  .dashboard-card h3 {
    font-size: 1.18rem;
  }

  .metric-detail,
  .hero-aside__meta,
  .hero-aside__label,
  .note-chip,
  th,
  td {
    font-size: 0.92rem;
  }

  .service-check-board__header h1,
  .contract-board__header h1 {
    font-size: 2rem;
  }

  .service-check-table th {
    font-size: 0.88rem;
  }

  .service-check-table td,
  .service-check-summary__headline,
  .service-check-summary__line,
  .service-check-averages__head,
  .service-check-averages__row {
    font-size: 0.82rem;
  }

  .service-check-category {
    width: 34%;
  }

  .service-check-summary__box,
  .service-check-averages {
    padding: 14px;
  }

  .service-check-legend {
    flex-direction: column;
    align-items: flex-start;
  }

  canvas {
    min-height: 220px;
    max-height: 320px;
  }

  table {
    min-width: 520px;
  }
}

/* ============================================================
   Премиальная анимация входа — Дашборд показателей Минцифры
   Дизайн-система: светлая, brand #3207FF, bg-soft #E8EAF0
   ============================================================ */

.login-page {
  position: fixed;
 inset: 0;
 display: grid;
 place-items: center;
 background:
   linear-gradient(180deg, rgba(215, 225, 251, 0.55) 0%, rgba(232, 234, 240, 0.38) 40%, var(--bg) 100%);
 overflow: hidden;
 font-family: "TT Firs Neue", "TT Firs Neue Light", "Inter", "Segoe UI", sans-serif;
 color: var(--text);
 z-index: 9999;
}

/* -------- Фоновая сетка -------- */
.login-bg {
 position: absolute;
 inset: 0;
 pointer-events: none;
 z-index: 0;
}

.login-bg__grid {
 position: absolute;
 inset: 0;
 background-image:
   linear-gradient(rgba(50, 7, 255, 0.045) 1px, transparent 1px),
   linear-gradient(90deg, rgba(50, 7, 255, 0.045) 1px, transparent 1px);
 background-size: 48px 48px;
 mask-image: radial-gradient(ellipse 65% 55% at 50% 45%, black 18%, transparent 72%);
 -webkit-mask-image: radial-gradient(ellipse 65% 55% at 50% 45%, black 18%, transparent 72%);
}

/* Точки в узлах сетки */
.login-bg__grid-dots {
 position: absolute;
 inset: 0;
 background-image: radial-gradient(circle, rgba(50, 7, 255, 0.09) 1.2px, transparent 1.2px);
 background-size: 48px 48px;
 mask-image: radial-gradient(ellipse 60% 50% at 50% 45%, black 14%, transparent 70%);
 -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 45%, black 14%, transparent 70%);
 opacity: 0;
 transition: opacity 0.8s ease;
}

.login-bg__grid-dots.active { opacity: 1; }

/* Эмблема — водяной знак */
.login-bg__emblem {
 position: absolute;
 top: 50%;
 left: 50%;
 width: min(520px, 62vw);
 height: min(520px, 62vw);
 transform: translate(-50%, -50%);
 opacity: 0.035;
 transition: opacity 0.8s ease;
}

.login-bg__emblem img {
 width: 100%;
 height: 100%;
}

/* Свечение в центре */
.login-bg__glow {
 position: absolute;
 top: 50%;
 left: 50%;
 width: 620px;
 height: 620px;
 transform: translate(-50%, -50%);
 background: radial-gradient(circle at center, rgba(50, 7, 255, 0.072) 0%, rgba(151, 172, 230, 0.025) 40%, transparent 72%);
 opacity: 0;
 transition: opacity 0.6s ease;
}

.login-bg__glow.active { opacity: 1; }

/* Импульсы передачи данных */
.login-bg__pulses { opacity: 0; }

.login-bg__pulses.active { opacity: 1; }

.login-bg__pulse {
 position: absolute;
 height: 1px;
 background: linear-gradient(90deg, transparent 0%, rgba(50, 7, 255, 0.14) 25%, rgba(151, 172, 230, 0.44) 55%, rgba(50, 7, 255, 0.14) 75%, transparent 100%);
 animation: login-pulse-sweep 2.8s ease-in-out infinite;
}

.login-bg__pulse:nth-child(1) { top: 26%; }
.login-bg__pulse:nth-child(2) { top: 50%; animation-delay: 0.9s; }
.login-bg__pulse:nth-child(3) { top: 74%; animation-delay: 1.8s; }

@keyframes login-pulse-sweep {
 0%   { left: -100%; width: 26%; opacity: 0; }
 15%  { opacity: 1; }
 50%  { left: 38%;   width: 38%; opacity: 1; }
 85%  { opacity: 1; }
 100% { left: 110%;  width: 26%; opacity: 0; }
}

/* -------- Карточка -------- */
.login-card {
 position: relative;
 z-index: 10;
 display: flex;
 flex-direction: column;
 align-items: center;
 width: min(468px, 92vw);
 padding: 40px 36px 34px;
 background: var(--bg);
 border: 1px solid rgba(151, 172, 230, 0.45);
 border-radius: 36px;
 box-shadow:
   0 28px 68px rgba(14, 0, 102, 0.09),
   0 0 0 1px rgba(215, 225, 251, 0.55) inset;
 transition:
   width 0.5s cubic-bezier(0.22, 0.61, 0.36, 1),
   padding 0.5s cubic-bezier(0.22, 0.61, 0.36, 1),
   border-radius 0.5s cubic-bezier(0.22, 0.61, 0.36, 1),
   box-shadow 0.6s ease,
   border-color 0.5s ease,
   opacity 0.35s ease;
 will-change: width, padding, border-radius, box-shadow, border-color, opacity;
}

/* Лёгкое дыхание карточки */
.login-card.validating {
 animation: login-card-breathe 2s ease-in-out infinite;
}

@keyframes login-card-breathe {
 0%, 100% { box-shadow: 0 28px 68px rgba(14, 0, 102, 0.09), 0 0 0 1px rgba(215, 225, 251, 0.55) inset, 0 0 0 0 rgba(50, 7, 255, 0); }
 50%      { box-shadow: 0 28px 72px rgba(14, 0, 102, 0.12), 0 0 0 1px rgba(215, 225, 251, 0.65) inset, 0 0 0 6px rgba(50, 7, 255, 0.05); }
}

.login-card.loading {
 width: min(340px, 80vw);
 padding: 36px 32px;
 border-radius: 42px;
 border-color: rgba(151, 172, 230, 0.55);
 box-shadow:
   0 32px 76px rgba(14, 0, 102, 0.14),
   0 0 0 1px rgba(215, 225, 251, 0.6) inset;
 animation: none;
}

.login-card.revealing {
 width: min(680px, 94vw);
 padding: 28px;
 border-radius: 38px;
 border-color: rgba(151, 172, 230, 0.25);
 box-shadow:
   0 36px 88px rgba(14, 0, 102, 0.06),
   0 0 0 1px rgba(215, 225, 251, 0.3) inset,
   0 0 60px rgba(50, 7, 255, 0.04);
 opacity: 0;
 transition:
   width 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
   padding 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
   border-radius 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
   border-color 0.5s ease,
   box-shadow 0.5s ease,
   opacity 0.45s ease 0.25s;
}

/* -------- Логотип -------- */
.login-logo-wrap {
 width: 100%;
 display: flex;
 justify-content: center;
 margin-bottom: 30px;
 position: relative;
 transition: margin 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.login-card.loading .login-logo-wrap { margin-bottom: 0; }

.login-logo {
 display: block;
 max-width: 100%;
 width: min(220px, 58%);
 height: auto;
 transition: width 0.5s cubic-bezier(0.22, 0.61, 0.36, 1), filter 0.5s ease;
}

.login-card.loading .login-logo {
 width: min(175px, 54%);
 animation: login-logo-pulse 2.4s ease-in-out infinite;
}

@keyframes login-logo-pulse {
 0%, 100% { filter: drop-shadow(0 0 0 transparent); }
 50%      { filter: drop-shadow(0 0 12px rgba(50, 7, 255, 0.15)); }
}

/* -------- SVG-кольца вокруг логотипа (двойное) -------- */
.login-ring {
 position: absolute;
 top: 50%;
 left: 50%;
 width: calc(100% + 48px);
 height: calc(100% + 48px);
 transform: translate(-50%, -50%);
 pointer-events: none;
 opacity: 0;
 transition: opacity 0.3s ease;
}

.login-ring:nth-of-type(1) { /* outer */ }
.login-ring:nth-of-type(2) { /* inner — через HTML */ }

.login-card.loading .login-ring { opacity: 1; }

.login-ring__path {
 fill: none;
 stroke: var(--brand);
 stroke-width: 1.3;
 stroke-dasharray: 564;
 stroke-dashoffset: 564;
 stroke-linecap: round;
 stroke-opacity: 0.5;
 animation: login-ring-draw 1.1s cubic-bezier(0.12, 0.71, 0.33, 1) forwards;
}

.login-ring__path--inner {
 stroke-width: 0.9;
 stroke-opacity: 0.3;
 stroke-dasharray: 584;
 stroke-dashoffset: 584;
 animation: login-ring-draw 1.1s cubic-bezier(0.12, 0.71, 0.33, 1) 0.18s forwards;
}

@keyframes login-ring-draw {
 to { stroke-dashoffset: 0; }
}

/* -------- Сетевые линии -------- */
.login-network {
 position: absolute;
 top: 50%;
 left: 50%;
 width: 340px;
 height: 340px;
 transform: translate(-50%, -50%);
 pointer-events: none;
 opacity: 0;
 transition: opacity 0.35s ease;
}

.login-card.loading .login-network { opacity: 1; }

.login-network__line {
 fill: none;
 stroke: var(--line-strong);
 stroke-width: 0.9;
 stroke-dasharray: 130;
 stroke-dashoffset: 130;
 stroke-linecap: round;
 stroke-opacity: 0.4;
 animation: login-line-draw 0.8s cubic-bezier(0.12, 0.71, 0.33, 1) forwards;
}

@keyframes login-line-draw {
 to { stroke-dashoffset: 0; }
}

.login-network__dot {
 fill: var(--brand);
 fill-opacity: 0.34;
 opacity: 0;
 animation: login-dot-appear 0.5s ease forwards;
}

.login-network__dot.pulse {
 animation:
   login-dot-appear 0.5s ease forwards,
   login-dot-breathe 1.6s ease-in-out 0.5s infinite;
}

@keyframes login-dot-appear {
 0%   { opacity: 0; r: 0; }
 60%  { opacity: 0.85; r: 2.8; }
 100% { opacity: 0.55; r: 2; }
}

@keyframes login-dot-breathe {
 0%, 100% { opacity: 0.55; r: 2;   fill-opacity: 0.34; }
 50%      { opacity: 0.8;  r: 2.8; fill-opacity: 0.55; }
}
/* -------- Форма -------- */
.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: opacity 0.25s ease;
}

.login-form.dimmed {
  opacity: 0.42;
  pointer-events: none;
}

.login-form__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-form__label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.login-form__input {
  height: 48px;
  padding: 0 15px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(151, 172, 230, 0.75);
  background: var(--bg);
  color: var(--text);
  font-size: 0.98rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form__input::placeholder {
  color: rgba(93, 103, 133, 0.38);
}

.login-form__input:focus {
  outline: 2px solid rgba(50, 7, 255, 0.18);
  border-color: var(--brand);
}

.login-form__input:disabled {
  background: var(--bg-soft);
  border-color: rgba(151, 172, 230, 0.35);
  color: var(--muted);
}

/* -------- Ошибка -------- */
.login-alert {
  width: 100%;
  padding: 13px 16px;
  border-radius: 18px;
  background: rgba(191, 23, 54, 0.08);
  border: 1px solid rgba(191, 23, 54, 0.2);
  color: var(--danger);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* -------- Кнопка -------- */
.login-button {
  position: relative;
  width: 100%;
  height: 50px;
  margin-top: 4px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease, opacity 0.2s ease;
}

.login-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(50, 7, 255, 0.28);
}

.login-button:active:not(:disabled) { transform: translateY(0); }

.login-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.login-button__content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.login-button__spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: login-spinner 0.7s linear infinite;
}

@keyframes login-spinner {
  to { transform: rotate(360deg); }
}

/* -------- Статусы загрузки -------- */
.login-statuses {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  margin-top: 26px;
  width: 100%;
}

.login-status {
  font-size: 0.86rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.login-status.visible { opacity: 1; transform: translateY(0); }

.login-status.done { opacity: 0.45; }

/* -------- Прогресс -------- */
.login-progress {
  width: 100%;
  margin-top: 20px;
}

.login-progress__track {
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: var(--bg-soft-2);
  overflow: hidden;
}

.login-progress__fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--line-strong) 0%, var(--brand) 100%);
  width: 0%;
  transition: width 0.25s ease;
}

/* -------- Прямая ссылка в навигации (без группы) -------- */
.nav-tree__link--standalone {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(151, 172, 230, 0.35);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.15;
}

.nav-tree__link--standalone:hover {
  background: rgba(255, 255, 255, 0.74);
  transform: translateX(2px);
  color: var(--text);
}

.nav-tree__link--standalone.is-active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: white;
  box-shadow: 0 14px 28px rgba(50, 7, 255, 0.2);
}

/* -------- Контакты -------- */
.contact-card {
  background: var(--bg);
  border: 1px solid rgba(151, 172, 230, 0.45);
  border-radius: 28px;
  padding: 28px 24px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 64px rgba(14, 0, 102, 0.12);
}

.contact-card__icon {
  font-size: 2.6rem;
  line-height: 1;
}

.contact-card__name {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
  color: var(--brand-deep);
}

.contact-card__role {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: -8px;
}

.contact-card__details {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid rgba(151, 172, 230, 0.35);
}

.contact-card__row {
  display: grid;
  gap: 2px;
}

.contact-card__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.contact-card__value {
  font-size: 0.95rem;
  color: var(--text);
  word-break: break-word;
}

a.contact-card__value {
  color: var(--brand);
  font-weight: 500;
  transition: color 120ms ease;
}

/* ── Audit change list ── */
.audit-changes {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.audit-changes li {
  padding: 2px 0;
  white-space: nowrap;
}

.audit-old-value {
  color: var(--danger);
  text-decoration: line-through;
  opacity: 0.8;
}

.audit-new-value {
  color: #0a8c3e;
  font-weight: 600;
}

a.contact-card__value:hover {
  color: var(--brand-dark);
}

/* -------- prefers-reduced-motion -------- */
@media (prefers-reduced-motion: reduce) {
  .login-card,
  .login-card.loading,
  .login-card.revealing {
    transition: opacity 0.35s ease !important;
  }

  .login-ring__path,
  .login-network__line,
  .login-network__dot {
    animation: none !important;
    opacity: 0 !important;
  }

  .login-bg__pulse { animation: none !important; }

  .login-status {
    transition: opacity 0.3s ease !important;
    transform: none !important;
  }
}

/* ============================================================
   Column Header Filters (TM-44)
   Inline filter controls embedded in <th> elements.
   ============================================================ */

.col-filter-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 140ms ease, background 140ms ease, border-color 140ms ease;
  vertical-align: middle;
  flex-shrink: 0;
}

.col-filter-trigger:hover,
th:hover .col-filter-trigger {
  opacity: 0.85;
  background: var(--bg-soft-2);
  border-color: var(--line-strong);
}

.has-col-filter .col-filter-trigger {
  opacity: 1;
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.has-col-filter .col-filter-trigger:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

/* Filter popover */
.col-filter-popover {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  margin-top: 4px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(14, 0, 102, 0.14);
  padding: 10px 12px;
  min-width: 280px;
  max-width: 420px;
}

.col-filter-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.col-filter-op {
  flex: 0 0 auto;
  min-width: 85px;
  max-width: 130px;
  padding: 8px 9px;
  border-radius: 8px;
  border: 1px solid rgba(151, 172, 230, 0.7);
  background: #fff;
  font-size: 13px;
}

.col-filter-value {
  flex: 2 1 140px;
  min-width: 100px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(151, 172, 230, 0.7);
  background: #fff;
  font-size: 13px;
}

.col-filter-value[hidden] {
  display: none;
}

.col-filter-apply,
.col-filter-clear {
  flex: 0 0 auto;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 8px;
}

/* Ensure th can host the popover */
th {
  position: relative;
}

/* Hide filter trigger on action columns */
th:last-child .col-filter-trigger,
.col-filter-skip .col-filter-trigger {
  display: none;
}
