/* ============================================================
   КАСКАДНЫЕ СЛОИ. Весь существующий CSS — в слое legacy.
   Новые компонентные правила пишите в @layer app { ... } —
   они побеждают legacy БЕЗ наращивания специфичности
   (html[data-theme] body ... для нового кода больше не нужен).
   ============================================================ */
@layer legacy, app;

@layer legacy {
/* ============================================================
   ДИЗАЙН-ТОКЕНЫ «Бизнес Контур»
   Единый источник палитры. Тема переключается через
   html[data-theme="light" | "dark"]. В компонентах — только var().
   Старые имена переменных сохранены как алиасы на новые токены,
   чтобы не переписывать разом всю таблицу стилей.
   ============================================================ */
:root {
  color-scheme: light;
  --font: "Inter", -apple-system, "Segoe UI", Roboto, ui-sans-serif, system-ui, Arial, sans-serif;

  /* — Светлая тема (базовые токены) — */
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f2f3f7;
  --surface-hover: #f8f8fc;
  --border: #e7e9ef;
  --border-strong: #d9dce5;
  --text: #16181d;
  --text-2: #5b6070;
  --text-3: #9298a8;
  --accent: #5b5bd6;
  --accent-hover: #4c4cc4;
  --accent-soft: #eeeefb;
  --accent-text: #4a4ac0;
  --green: #1b9e5a;
  --green-soft: #e3f6ec;
  --amber: #b97d10;
  --amber-soft: #fbf1dc;
  --red: #d6455b;
  --red-soft: #fbe9ec;
  --shadow-sm: 0 1px 2px rgba(20, 22, 40, 0.05);
  --shadow-md: 0 4px 16px rgba(20, 22, 40, 0.07);
  --shadow-lg: 0 16px 48px rgba(20, 22, 40, 0.1), 0 2px 8px rgba(20, 22, 40, 0.05);
  --glow-1: rgba(91, 91, 214, 0.1);
  --glow-2: rgba(123, 91, 214, 0.08);
  --contour: rgba(91, 91, 214, 0.13);
  --sidebar-bg: #ffffff;

  /* — Алиасы: старые имена → новые токены — */
  --muted: var(--text-2);
  --line: var(--border);
  --blue: var(--accent);
  --blue-dark: var(--accent-hover);
  --teal: var(--accent);
  --shadow: var(--shadow-md);
  --sidebar-text: var(--text);
  --sidebar-muted: var(--text-3);
  --sidebar-line: var(--border);
  --sidebar-hover: var(--surface-2);
  --sidebar-count: var(--surface-2);
  --mark-color: #ffffff;
  --mark-bg: var(--accent);
  --main-padding: 26px 28px;
  --panel-radius: 14px;
  --control-radius: 10px;
  --table-row-padding: 18px 20px;
  --table-row-gap: 20px;
  --table-row-shadow: none;
  --table-row-hover-shadow: none;
  --toolbar-surface: transparent;
  --topbar-surface: var(--surface);
  --topbar-border: var(--border);
  --focus-ring: var(--accent-soft);

  font-family: var(--font);
}

html[data-theme="dark"] {
  color-scheme: dark;

  /* — Тёмная тема (переопределяем только базовые токены; алиасы наследуют) — */
  --bg: #0d0e12;
  --surface: #15161c;
  --surface-2: #1c1e26;
  --surface-hover: #1a1c24;
  --border: #262934;
  --border-strong: #333749;
  --text: #edeef3;
  --text-2: #a3a8b8;
  --text-3: #666c7e;
  --accent: #8c8cf2;
  --accent-hover: #a0a0f6;
  --accent-soft: #23244035;
  --accent-text: #a6a6f5;
  --green: #3dd186;
  --green-soft: #12281d;
  --amber: #e5a93d;
  --amber-soft: #2b2213;
  --red: #f0637a;
  --red-soft: #2e1820;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
  --glow-1: rgba(140, 140, 242, 0.13);
  --glow-2: rgba(123, 91, 214, 0.1);
  --contour: rgba(140, 140, 242, 0.14);
  --sidebar-bg: #101116;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  transition:
    color 160ms ease,
    background 160ms ease;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

/* ============ СТРАНИЦА ВХОДА ============ */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

/* Мягкие свечения на фоне */
.auth-page::before,
.auth-page::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}

.auth-page::before {
  width: 560px;
  height: 560px;
  background: var(--glow-1);
  top: -160px;
  right: -120px;
}

.auth-page::after {
  width: 480px;
  height: 480px;
  background: var(--glow-2);
  bottom: -180px;
  left: -100px;
}

/* Контурные линии (изолинии) — отсылка к названию «Контур» */
.auth-bg-art {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.auth-bg-art path {
  fill: none;
  stroke: var(--contour);
  stroke-width: 1.3;
}

.auth-card {
  width: 400px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 34px 30px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.auth-logo .logo-mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.auth-logo-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.auth-logo-sub {
  font-size: 0.72rem;
  color: var(--text-3);
  font-weight: 500;
}

.auth-card h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}

.auth-sub {
  font-size: 0.84rem;
  color: var(--text-3);
  margin: 0 0 24px;
}

.auth-field {
  margin-bottom: 16px;
}

.auth-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 7px;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap > svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-3);
}

.auth-input-wrap input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition:
    border 0.15s,
    box-shadow 0.15s;
}

.auth-input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-input-wrap input::placeholder {
  color: var(--text-3);
}

.auth-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  color: var(--text-3);
  display: grid;
  place-items: center;
  border-radius: 7px;
}

.auth-eye:hover {
  color: var(--text-2);
  background: var(--surface-2);
}

.auth-eye svg {
  width: 16px;
  height: 16px;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 20px;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.auth-remember input {
  width: 15px;
  height: 15px;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.auth-submit {
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    background 0.15s,
    transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s;
}

.auth-submit:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 38%, transparent);
}

.auth-submit:active {
  transform: scale(0.97);
}

.auth-submit:disabled {
  opacity: 0.7;
  cursor: default;
}

.auth-error {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 9px;
  margin-bottom: 16px;
}

.auth-error.show {
  display: flex;
  animation: authFadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-error svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.auth-foot {
  margin-top: 22px;
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-3);
}

.auth-theme-btn {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s;
}

.auth-theme-btn:hover {
  background: var(--surface-2);
}

.auth-theme-btn svg {
  width: 17px;
  height: 17px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-theme-btn:hover svg {
  transform: rotate(20deg);
}

/* Анимации логина */
@keyframes authCardIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes authFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.auth-card {
  animation: authCardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-logo {
  animation: authFadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

.auth-card h1,
.auth-sub {
  animation: authFadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.14s both;
}

.auth-field,
.auth-row,
.auth-submit,
.auth-foot {
  animation: authFadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-field:nth-of-type(1) {
  animation-delay: 0.2s;
}

.auth-field:nth-of-type(2) {
  animation-delay: 0.26s;
}

.auth-row {
  animation-delay: 0.32s;
}

.auth-submit {
  animation-delay: 0.38s;
}

.auth-foot {
  animation-delay: 0.44s;
}

.auth-ripple {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  opacity: 0.25;
  transform: scale(0);
  animation: authRip 0.5s ease-out forwards;
  pointer-events: none;
}

@keyframes authRip {
  to {
    transform: scale(3);
    opacity: 0;
  }
}

/* Встряска карточки при ошибке */
@keyframes authShake {
  10%,
  90% {
    transform: translateX(-1px);
  }
  20%,
  80% {
    transform: translateX(2px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-4px);
  }
  40%,
  60% {
    transform: translateX(4px);
  }
}

.auth-card.shake {
  animation: authShake 0.5s ease;
}

/* Эмблема: контуры «дышат» при наведении */
.auth-logo .logo-mark circle,
.auth-logo .logo-mark path {
  transform-origin: 24px 24px;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-logo:hover .logo-mark path:first-of-type {
  transform: rotate(8deg);
}

.auth-logo:hover .logo-mark path:last-of-type {
  transform: rotate(-6deg);
}

.audit-list {
  display: grid;
  gap: 8px;
}

.audit-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.audit-main,
.audit-meta {
  display: grid;
  gap: 4px;
}

.audit-main span,
.audit-meta {
  color: var(--muted);
  font-size: 13px;
}

.audit-meta {
  text-align: right;
}

.audit-toggle {
  justify-self: start;
  margin-top: 4px;
}

.user-admin-grid {
  align-items: start;
}

.user-list,
.user-form,
.security-list {
  display: grid;
  gap: 10px;
}

.user-item,
.security-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.security-item.blocked {
  border-color: rgba(186, 47, 47, 0.42);
  background: #fff7f7;
}

.user-item strong,
.user-item span,
.security-item strong,
.security-item span {
  display: block;
}

.user-item span,
.security-item span,
.form-note {
  color: var(--muted);
  font-size: 13px;
}

.security-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.user-actions {
  display: flex;
  gap: 8px;
}

.user-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.user-form input,
.user-form select {
  width: 100%;
}

.form-note {
  min-height: 20px;
  margin: 0;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  max-height: 100vh;
  padding: 22px;
  color: var(--sidebar-text);
  background: var(--sidebar-bg);
  overflow: hidden;
}

.logout-button {
  margin-top: 0;
  flex: 0 0 auto;
}

.theme-toggle {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--sidebar-line);
  border-radius: 10px;
  color: var(--sidebar-text);
  background: transparent;
  text-align: left;
  margin-top: auto;
}

.theme-toggle:hover {
  background: var(--sidebar-hover);
}

.theme-toggle-icon {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.theme-toggle-icon::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 18px;
  border-radius: 0 999px 999px 0;
  background: var(--sidebar-bg);
}

html[data-theme="light"] .theme-toggle-icon::after {
  top: -2px;
  right: -2px;
  width: 9px;
  height: 18px;
  border-radius: 0 999px 999px 0;
  background: var(--sidebar-bg);
  box-shadow: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  color: var(--mark-color);
  background: var(--mark-bg);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.sidebar-note p,
.sidebar-note span {
  color: var(--sidebar-muted);
}

.nav {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.nav::-webkit-scrollbar {
  width: 8px;
}

.nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 6px;
  color: #dbe4ee;
  background: transparent;
  text-align: left;
}

.nav-count {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--sidebar-count);
  text-align: center;
  font-size: 12px;
  line-height: 1.45;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.admin-nav {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--sidebar-line);
}

.nav-section-title {
  padding: 0 12px 4px;
  color: #8ea0b2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-caret {
  color: #b8c2cc;
  font-size: 12px;
  line-height: 1;
  transition: transform 160ms ease;
}

.nav-group.expanded .nav-caret {
  transform: rotate(180deg);
}

.nav-subitems {
  display: none;
  gap: 4px;
  padding-left: 12px;
}

.nav-group.expanded .nav-subitems {
  display: grid;
}

.nav-item.sub {
  padding: 9px 10px;
  color: #c9d3de;
  font-size: 13px;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: var(--sidebar-hover);
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-note span,
.sidebar-note strong,
.sidebar-note p {
  display: block;
}

.sidebar-note strong {
  margin: 6px 0;
  line-height: 1.35;
}

.sidebar-note p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.main {
  min-width: 0;
  padding: var(--main-padding);
}

.topbar {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--topbar-border);
  border-radius: var(--panel-radius);
  background: var(--topbar-surface);
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0 0 6px;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.topbar p,
.muted {
  color: var(--muted);
}

.topbar p {
  margin: 0;
}

.current-user {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  max-width: 260px;
  padding: 6px 10px 6px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--table-row-shadow);
}

.security-notice {
  margin-left: auto;
  border: 1px solid rgba(217, 164, 65, 0.45);
  border-radius: 7px;
  padding: 8px 12px;
  color: #f0bd58;
  background: rgba(217, 164, 65, 0.1);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.security-notice:hover {
  background: rgba(217, 164, 65, 0.18);
}

.system-health {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  border: 1px solid rgba(48, 182, 126, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  background: rgba(48, 182, 126, 0.08);
}

.system-health.warning {
  border-color: rgba(217, 164, 65, 0.4);
  background: rgba(217, 164, 65, 0.1);
}

.system-health span {
  color: var(--muted);
}

.auth-sun-icon {
  display: none;
}

.auth-password-input {
  padding-right: 40px;
}

.error-card {
  text-align: center;
}

.error-logo {
  justify-content: center;
}

.error-brand-copy {
  text-align: left;
}

.error-code {
  color: var(--accent);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}

.error-title {
  margin: 14px 0 6px;
}

.error-copy {
  margin-bottom: 24px;
}

.error-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-decoration: none;
}

.current-user-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--blue);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.current-user-text {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.current-user-text strong,
.current-user-text small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-user-text strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.current-user-text small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.top-actions,
.form-actions,
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.scope-controls {
  display: flex;
  flex: 1 1 420px;
  gap: 8px;
  justify-content: flex-end;
}

.scope-controls label {
  min-width: 180px;
  color: var(--muted);
  font-size: 12px;
}

.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-title-row h2,
.panel-title-row p {
  margin: 0;
}

.panel-title-row p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.panel-title-row > span {
  padding: 5px 10px;
  border-radius: 999px;
  color: #314052;
  background: var(--surface-2);
  font-weight: 700;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
  white-space: nowrap;
}

.button.primary {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.button.primary:hover {
  background: var(--blue-dark);
}

.button.ghost:hover {
  background: var(--surface-2);
}

.button.danger {
  color: var(--red);
  border-color: #f1c2c2;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: var(--control-radius);
  background: var(--surface-2);
  font-size: 24px;
  line-height: 1;
}

.tab {
  display: none;
}

.tab.active {
  display: block;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

#dashboard .stats {
  max-width: 1480px;
}

.dashboard-title {
  max-width: 1480px;
}

.dashboard-title > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.dashboard-stat {
  width: 100%;
  color: inherit;
  text-align: left;
}

.dashboard-stat:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.dashboard-stat.tone-green small,
.dashboard-stat.tone-green strong {
  color: var(--green);
}

.dashboard-stat.tone-amber small,
.dashboard-stat.tone-amber strong {
  color: var(--amber);
}

.dashboard-stat.tone-red small,
.dashboard-stat.tone-red strong {
  color: var(--red);
}

.dashboard-stat.tone-blue small,
.dashboard-stat.tone-blue strong {
  color: var(--accent);
}

.dashboard-stat.tone-purple small,
.dashboard-stat.tone-purple strong {
  color: #8f65f2;
}

.dashboard-layout {
  max-width: 1480px;
  margin-top: 16px;
}

.dashboard-overview {
  display: grid;
  gap: 18px;
}

.dashboard-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-ratio-card {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.dashboard-ratio-card span,
.dashboard-ratio-card strong,
.dashboard-ratio-card small {
  display: block;
}

.dashboard-ratio-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-ratio-card strong {
  margin-top: 8px;
  color: var(--text);
  font-size: 24px;
  font-weight: 850;
}

.dashboard-ratio-card small {
  margin-top: 2px;
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-ratio-card.tone-green strong,
.dashboard-ratio-card.tone-green small {
  color: var(--green);
}

.dashboard-ratio-card.tone-amber strong,
.dashboard-ratio-card.tone-amber small {
  color: var(--amber);
}

.dashboard-ratio-card.tone-red strong,
.dashboard-ratio-card.tone-red small {
  color: var(--red);
}

.dashboard-ratio-card.tone-blue strong,
.dashboard-ratio-card.tone-blue small {
  color: var(--accent);
}

.dashboard-ratio-card.tone-purple strong,
.dashboard-ratio-card.tone-purple small {
  color: #8f65f2;
}

.dashboard-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-split h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.dashboard-mini-bar {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.dashboard-mini-bar > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.dashboard-mini-bar b {
  color: var(--muted);
  white-space: nowrap;
}

.dashboard-problem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.dashboard-problem strong,
.dashboard-problem span {
  display: block;
}

.dashboard-problem strong {
  font-size: 14px;
}

.dashboard-problem span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-problem b {
  font-size: 24px;
}

.dashboard-problem.tone-red b {
  color: var(--red);
}

.dashboard-problem.tone-amber b {
  color: var(--amber);
}

.dashboard-problem.tone-green b {
  color: var(--green);
}

.dashboard-problem.tone-blue b {
  color: var(--accent);
}

.dashboard-import {
  display: grid;
  gap: 14px;
}

.dashboard-import-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-import-head strong {
  font-size: 24px;
  font-weight: 850;
}

.dashboard-import-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.dashboard-import-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-import-grid > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.dashboard-import-grid span,
.dashboard-import-grid strong {
  display: block;
}

.dashboard-import-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.dashboard-import-grid strong {
  margin-top: 6px;
  font-size: 18px;
}

.dashboard-theme-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-theme-strip span {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--accent-text);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 800;
}

.stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.layout.two {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.9fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel h2 {
  margin: 0;
  font-size: 18px;
}

.lead-list {
  display: grid;
  gap: 10px;
}

.lead-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface);
}

.lead-card:hover {
  border-color: #b9c9d9;
}

.score {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: var(--panel-radius);
  color: #fff;
  background: var(--teal);
  font-weight: 800;
}

.score.grade-a {
  background: var(--green);
}

.score.grade-b {
  background: var(--teal);
}

.score.grade-c {
  background: var(--amber);
}

.score.grade-d {
  background: var(--muted);
}

.lead-card h3 {
  margin: 0 0 5px;
  font-size: 16px;
  line-height: 1.3;
}

.meta,
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.tag {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-2);
}

.summary {
  display: -webkit-box;
  margin: 8px 0 0;
  overflow: hidden;
  color: #3e4a59;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.facts {
  display: grid;
  gap: 14px;
}

.service-client-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.service-client-card {
  display: grid;
  gap: 10px;
  min-height: 160px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.service-client-card h3,
.service-client-card p {
  margin: 0;
}

.service-client-card p,
.service-client-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.service-client-card strong {
  align-self: end;
  font-size: 28px;
}

.fact-group h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 42px;
  gap: 8px;
  align-items: center;
  margin: 7px 0;
  color: #364252;
  font-size: 13px;
}

.bar-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.bar span {
  display: block;
  height: 100%;
  background: var(--blue);
}


.toolbar {
  align-items: stretch;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--toolbar-surface);
  margin-bottom: 14px;
}

.toolbar input,
.toolbar select {
  min-height: 42px;
}

.toolbar input {
  flex: 1 1 360px;
  min-width: 280px;
}

.toolbar select {
  flex: 0 1 240px;
  min-width: 180px;
}

.segment-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--table-row-shadow);
  margin-bottom: 16px;
}

.segment-switch[hidden] {
  display: none;
}

.segment-switch button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.segment-switch button:hover {
  color: var(--text);
  background: var(--surface-2);
}

.segment-switch button.active {
  color: #ffffff;
  background: var(--blue);
}

.segment-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 20px;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 850;
}

.segment-switch button.active .segment-count {
  color: var(--blue);
  background: #ffffff;
}

.toolbar.search-only {
  display: block;
}

.toolbar.search-only input {
  width: 100%;
}

.toolbar.search-only select[hidden] {
  display: none;
}

.compact-toolbar input {
  flex-basis: 280px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  color: var(--text);
  background: var(--surface);
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 1px;
}

input,
select {
  height: 40px;
  padding: 0 10px;
}

textarea {
  padding: 10px;
  resize: vertical;
}

.lead-table {
  display: grid;
  gap: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: 72px minmax(260px, 1fr) 140px minmax(190px, 0.7fr) 150px 110px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.table-row.header {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  font-size: 13px;
}

.cell-main strong {
  display: block;
  margin-bottom: 3px;
}

.cell-main span,
.cell-muted {
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  justify-self: start;
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  color: #314052;
  background: var(--surface-2);
  font-size: 13px;
}

.status-pill + .status-pill {
  margin-left: 4px;
}

.bitrix-pill {
  color: #176b45;
  background: #dff5e8;
}

.bitrix-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.tender-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tender-pill,
.tender-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tender-pill.active,
.tender-status.active {
  color: #0f6131;
  background: #dff3e7;
}

.tender-pill.closed,
.tender-status.closed {
  color: #6a4a00;
  background: #f7ead1;
}

.tender-pill.unknown,
.tender-status.unknown {
  color: #455365;
  background: var(--surface-2);
}

.tender-status.focused {
  color: #174ea6;
  background: #dbeafe;
}

.tender-pill.law,
.tender-law {
  color: #24476b;
  background: #e2edf7;
}

.tender-flags {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.tender-law {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tender-money-line {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.briefs {
  display: grid;
  gap: 12px;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.source-grid.single {
  grid-template-columns: 1fr;
}

.source-card {
  display: grid;
  gap: 6px;
  min-height: 104px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  text-decoration: none;
}

.source-card:hover {
  border-color: #aebdca;
  background: #f9fbfc;
}

.source-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.procurement-queries {
  display: grid;
  gap: 12px;
}

.procurement-group {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.procurement-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.procurement-title h3 {
  margin: 0;
  font-size: 16px;
}

.grade-chip {
  display: inline-grid;
  min-width: 30px;
  height: 26px;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
}

.brief {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.brief h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.brief p {
  margin: 0 0 10px;
  color: #3f4b59;
  font-size: 13px;
  line-height: 1.45;
}

.query-list {
  display: grid;
  gap: 7px;
}

.query {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  border-radius: 6px;
  background: var(--surface-2);
}

.procurement-query {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto auto;
}

.query code {
  overflow-wrap: anywhere;
  color: #283547;
  font-size: 12px;
}

.query a {
  flex: 0 0 auto;
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.stack {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #2f3a47;
  font-size: 13px;
  font-weight: 650;
}

.enrich-result {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-2);
  color: #2f3a47;
  line-height: 1.5;
}

.quality-list {
  margin: 0;
  padding-left: 18px;
  color: #344150;
  line-height: 1.65;
}

.procurement-rules {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.commercial-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.mini-stat {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.mini-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.queue-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.queue-row {
  grid-template-columns: 72px minmax(240px, 1fr) minmax(180px, 0.7fr) minmax(190px, 0.7fr) 150px 150px;
}

.queue-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.reason-pill,
.folder-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #24476b;
  background: #e2edf7;
  font-size: 12px;
  font-weight: 700;
}

.duplicate-groups {
  display: grid;
  gap: 12px;
}

.duplicate-group {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.duplicate-group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.duplicate-group-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.duplicate-group-head p,
.duplicate-lead-row span,
.duplicate-tender-row span,
.similar-row span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.duplicate-counters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.duplicate-counters span {
  padding: 4px 8px;
  border-radius: 999px;
  color: #314052;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
}

.duplicate-lead-list,
.duplicate-tender-list,
.similar-list {
  display: grid;
  gap: 7px;
}

.duplicate-lead-row,
.similar-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) minmax(170px, 0.35fr) 70px;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
}

.similar-row {
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.45fr);
}

.duplicate-lead-row:hover,
.similar-row:hover {
  background: #e6edf3;
}

.duplicate-lead-row .score {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  font-size: 14px;
}

.duplicate-tender-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 130px 80px;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.duplicate-tender-row strong,
.duplicate-tender-row span {
  display: block;
}

.duplicate-tender-row a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.similar-leads {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.similar-leads:empty {
  display: none;
}

.similar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.similar-head h3 {
  margin: 0;
  font-size: 15px;
}

.similar-head span {
  color: var(--muted);
  font-size: 13px;
}

.similar-tenders {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: #344150;
  font-size: 13px;
  line-height: 1.45;
}

.platform-list {
  display: grid;
  max-height: 620px;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.platform-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.45fr);
  gap: 12px;
  align-items: start;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.platform-row strong {
  display: block;
  margin-bottom: 4px;
}

.platform-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.platform-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.access-chip {
  display: inline-flex;
  min-width: 28px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
}

.access-a {
  background: var(--green);
}

.access-b {
  background: var(--blue);
}

.access-c {
  background: var(--amber);
}

.access-d {
  background: var(--muted);
}

.tenderplan-box {
  display: grid;
  gap: 12px;
}

.tenderplan-status {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #344150;
  background: var(--surface-2);
  font-size: 13px;
}

.tenderplan-list {
  display: grid;
  max-height: 520px;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.tenderplan-item {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tenderplan-item strong {
  display: block;
  line-height: 1.35;
}

.tenderplan-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.tenderplan-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.tenderplan-meta span {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--surface-2);
}

.tenderplan-actions {
  margin-top: 0;
}

.sync-status {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
}

.sync-status.warning { color: var(--amber); }
.sync-status.danger { color: var(--red); }

.tenderplan-import-log {
  display: grid;
  gap: 8px;
}

.import-log-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.import-report {
  display: grid;
  gap: 12px;
}

.import-report-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.import-report-top div {
  display: grid;
  gap: 3px;
}

.import-report-top strong {
  font-size: 15px;
}

.import-report-top span,
.import-report-actions span {
  color: var(--muted);
  font-size: 12px;
}

.import-report-actions {
  text-align: right;
}

.import-quality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.import-quality-card {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.import-quality-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(31, 41, 55, 0.08);
}

.import-quality-card.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.import-quality-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.import-quality-card strong {
  font-size: 22px;
  line-height: 1;
}

.import-quality-card.ok strong {
  color: var(--green);
}

.import-quality-card.warn strong {
  color: var(--yellow);
}

.import-quality-card.danger strong {
  color: var(--red);
}

.import-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.import-filter-bar.active {
  border-color: rgba(37, 99, 235, 0.24);
  background: rgba(37, 99, 235, 0.06);
}

.import-filter-bar .button {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 12px;
}

.import-log-head strong {
  color: var(--green);
}

.import-log-head span {
  color: var(--muted);
}

.import-log-head .danger {
  color: var(--red);
}

.import-log-item {
  display: grid;
  gap: 7px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.import-log-item strong {
  line-height: 1.35;
}

.import-log-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.import-log-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.import-log-item.created {
  border-color: rgba(44, 142, 78, 0.28);
  background: #fbfffc;
}

.import-log-item.complete {
  border-color: rgba(44, 142, 78, 0.34);
}

.import-log-item.partial {
  border-color: rgba(213, 151, 27, 0.36);
}

.import-log-item.duplicate {
  background: #fbfcfe;
}

.import-log-item.error {
  border-color: rgba(200, 55, 55, 0.35);
  background: #fff7f7;
}

.danger-text {
  color: var(--red) !important;
}

.import-log-substatus {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-pill.complete {
  color: var(--green);
  background: rgba(44, 142, 78, 0.12);
}

.status-pill.partial {
  color: var(--yellow);
  background: rgba(213, 151, 27, 0.14);
}

.import-issue-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.import-issue-list span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.import-issue-list .ok {
  color: var(--green);
  background: rgba(44, 142, 78, 0.12);
}

.import-issue-list .warn {
  color: var(--yellow);
  background: rgba(213, 151, 27, 0.14);
}

.import-issue-list .danger {
  color: var(--red);
  background: rgba(200, 55, 55, 0.12);
}

.tenderplan-meta a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.rule-block h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.rule-block ol,
.rule-block ul {
  margin: 0;
  padding-left: 20px;
  color: #344150;
  line-height: 1.55;
}

.icp {
  display: grid;
  gap: 14px;
}

.icp-block h3 {
  margin: 0 0 7px;
  font-size: 14px;
}

.icp-block p,
.icp-block ul {
  margin: 0;
  color: #3f4b59;
  line-height: 1.55;
}

.icp-block ul {
  padding-left: 18px;
}

.score-rules {
  display: grid;
  gap: 10px;
}

.score-rules div {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.score-rules strong {
  color: var(--blue);
  font-size: 22px;
}

dialog {
  width: min(920px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(14, 26, 39, 0.28);
}

dialog::backdrop {
  background: rgba(11, 20, 31, 0.48);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.dialog-head h2 {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid.tight {
  gap: 10px;
}

.tender-history {
  margin: 18px 0 4px;
}

.tender-history:empty {
  display: none;
}

.tender-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.tender-history-head h3 {
  margin: 0;
  font-size: 16px;
}

.tender-money-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.tender-money-summary div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tender-money-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.tender-money-summary strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.tender-focus-note {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(0, 1fr) minmax(130px, 0.28fr);
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(31, 111, 235, 0.32);
  border-radius: 8px;
  background: #f3f8ff;
  color: #203650;
  font-size: 13px;
}

.tender-focus-note strong,
.tender-focus-note span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tender-history-list {
  display: grid;
  max-height: 280px;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.tender-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.tender-item.selected {
  border-color: rgba(31, 111, 235, 0.48);
  background: #f8fbff;
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.08);
}

.tender-item > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tender-item p {
  margin: 7px 0;
  color: #344150;
  font-size: 13px;
  line-height: 1.45;
}

.tender-money-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 7px;
  color: #344150;
  font-size: 13px;
}

.tender-money-grid span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tender-item a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.wide {
  grid-column: 1 / -1;
}

.spacer {
  flex: 1;
}

.empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.bk-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.bk-load-more .button {
  min-width: 180px;
}

.bk-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.bk-filter-card {
  width: 100%;
  min-height: auto;
  justify-content: start;
  text-align: left;
  appearance: none;
  cursor: pointer;
}

.bk-filter-card:hover {
  border-color: rgba(31, 111, 235, 0.35);
  background: #fbfdff;
}

.bk-filter-card.active {
  border-color: rgba(31, 111, 235, 0.48);
  background: #eef6ff;
}

.bk-table {
  gap: 10px;
}

.bk-table.is-loading {
  opacity: 0.58;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.integration-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.integration-chip,
.integration-row {
  border: 1px solid var(--border);
  background: var(--surface);
}

.integration-chip {
  padding: 14px;
  display: grid;
  gap: 5px;
}

.integration-chip.is-clickable {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
}

.integration-chip.is-clickable:hover,
.integration-chip.is-clickable:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.integration-chip.ok strong { color: var(--green); }
.integration-chip.error strong { color: var(--red); }

.integration-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 0;
}

.integration-row:last-child { border-bottom: 1px solid var(--border); }
.integration-row > div { display: grid; gap: 4px; min-width: 0; }
.integration-row span,
.integration-row time { color: var(--text-3); font-size: 12px; }

.integration-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.integration-job-target,
.integration-target-link {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.integration-target-link {
  padding: 0;
  border: 0;
  color: var(--accent);
  font: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.integration-target-link:hover b,
.integration-target-link:focus-visible b { text-decoration: underline; }
.integration-target-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.integration-job-target small,
.integration-target-link small { color: var(--text-3); font-size: 12px; }

@media (max-width: 760px) {
  .integration-summary { grid-template-columns: 1fr; }
  .integration-row { align-items: flex-start; flex-direction: column; }
}

.bk-table-row {
  display: grid;
  grid-template-columns: 82px minmax(320px, 1.35fr) minmax(260px, 0.8fr) minmax(230px, 0.65fr);
  gap: var(--table-row-gap);
  align-items: start;
  padding: var(--table-row-padding);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface);
  box-shadow: var(--table-row-shadow);
}

.bk-lead-row {
  grid-template-columns: 82px minmax(280px, 1.2fr) minmax(240px, 1fr) minmax(220px, 1fr) 130px 130px;
}

.bk-table-head {
  padding: 0 12px 4px;
  border: 0;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.bk-sort-head {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  min-width: 0;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  text-transform: inherit;
  white-space: nowrap;
}

.bk-sort-head:hover,
.bk-sort-head.active {
  color: var(--blue);
}

.bk-sort-head span,
.bk-sort-head b {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.bk-sort-head b {
  min-width: 10px;
  font-weight: 800;
}

.bk-table-row strong,
.bk-table-row span,
.bk-table-row a {
  min-width: 0;
  overflow-wrap: anywhere;
}

.bk-table-row .bk-sort-head span,
.bk-table-row .bk-sort-head b {
  display: inline;
  margin: 0;
  overflow-wrap: normal;
  white-space: nowrap;
}

.bk-table-row:not(.bk-table-head) {
  cursor: pointer;
}

.bk-table-row:not(.bk-table-head):hover {
  border-color: rgba(31, 111, 235, 0.35);
  box-shadow: var(--table-row-hover-shadow);
}

.bk-score {
  align-self: center;
  width: 48px;
  height: 48px;
}

.bk-table-row strong {
  display: block;
}

.bk-table-row span,
.bk-table-row a {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.bk-table-row a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.bk-table-row .status-pill {
  display: inline-block;
  margin-top: 0;
  color: #335065;
}

.bk-table-row .bitrix-pill {
  color: #176b45;
  background: #dff5e8;
}

.advance-pill {
  display: inline-block;
  margin-top: 7px;
  padding: 4px 7px;
  border-radius: 999px;
  color: #526173;
  background: #eef2f4;
  font-size: 12px;
  font-weight: 700;
}

.advance-pill.yes {
  color: #176b45;
  background: #dff5e8;
}

.bk-main-cell {
  display: grid;
  gap: 2px;
}

.bk-docs {
  display: grid;
  gap: 5px;
}

.bk-row-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  margin-top: 6px;
}

.bk-deadline-amount-head {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  color: inherit;
}

.bk-deadline-amount-head > span {
  margin: 0;
  color: inherit;
  font: inherit;
}

.bk-deadline-amount-cell {
  display: grid;
  justify-items: start;
  gap: 7px;
}

.bk-amount {
  font-size: 17px;
}

.deadline-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 5px 11px;
  border-radius: 999px;
  color: #4b5565;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.deadline-pill::before {
  content: none;
}

.deadline-clock {
  display: block;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.deadline-pill > span {
  display: inline;
  margin-top: 0;
  color: inherit;
  font: inherit;
  line-height: inherit;
}

.deadline-pill.today {
  color: #a61935;
  background: #ffe5eb;
}

.deadline-pill.tomorrow,
.deadline-pill.soon {
  color: #7a4b00;
  background: #fff0cf;
}

.deadline-pill.expired {
  color: #6b7280;
  background: #eef0f4;
}

.deadline-pill.later,
.deadline-pill.unknown {
  color: #526173;
  background: #eef2f4;
}

.key-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.theme-pills {
  margin-top: 6px;
}

.key-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  color: #285a70;
  background: #e8f6fb;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.key-pill.main-theme {
  color: #fff;
  background: var(--blue);
}

.key-pill.secondary-theme {
  color: #526173;
  background: #eef2f4;
}

.bk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.bk-actions .button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.bk-import-status {
  display: grid;
  gap: 10px;
  min-height: 32px;
}

.bk-import-list {
  display: grid;
  gap: 8px;
}

html[data-theme] body .import-report-top,
html[data-theme] body .import-log-head,
html[data-theme] body .import-quality-card,
html[data-theme] body .import-log-item {
  border-color: var(--border);
  background: var(--surface);
}

html[data-theme] body .import-log-item.created.complete {
  border-color: color-mix(in srgb, var(--green) 34%, var(--border));
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
}

html[data-theme] body .import-log-item.partial {
  border-color: color-mix(in srgb, var(--yellow) 38%, var(--border));
  background: color-mix(in srgb, var(--yellow) 8%, var(--surface));
}

html[data-theme] body .import-log-item.error {
  border-color: color-mix(in srgb, var(--red) 42%, var(--border));
  background: color-mix(in srgb, var(--red) 8%, var(--surface));
}

html[data-theme] body .import-log-head strong {
  color: var(--green);
}

html[data-theme] body .import-quality-card strong {
  color: var(--text);
}

html[data-theme] body .import-quality-card:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

html[data-theme] body .import-quality-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

html[data-theme] body .import-filter-bar {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-3);
}

html[data-theme] body .import-filter-bar.active {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

html[data-theme] body .import-quality-card.ok strong {
  color: var(--green);
}

html[data-theme] body .import-quality-card.warn strong {
  color: var(--yellow);
}

html[data-theme] body .import-quality-card.danger strong {
  color: var(--red);
}

@media (max-width: 980px) {
  .import-quality-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .import-report-top {
    display: grid;
  }

  .import-report-actions {
    text-align: left;
  }

  .import-quality-grid {
    grid-template-columns: 1fr;
  }
}

.muted {
  color: var(--muted);
}

body .shell {
  grid-template-columns: 248px minmax(0, 1fr);
  background: var(--bg);
}

body .sidebar {
  gap: 12px;
  padding: 22px 12px;
  border-right: 1px solid var(--sidebar-line);
  box-shadow: none;
}

body .brand {
  gap: 10px;
  padding: 4px 10px 10px;
}

body .mark {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  letter-spacing: 0.02em;
}

body .brand strong {
  color: var(--text);
  font-size: 15px;
}

body .brand small,
body .nav-section-title {
  color: var(--sidebar-muted);
}

body .nav {
  gap: 2px;
  scrollbar-color: #2a2d39 transparent;
}

body .nav::-webkit-scrollbar-thumb {
  background: #2a2d39;
}

body .nav-item {
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

body .nav-item.sub {
  padding: 7px 10px 7px 14px;
  color: var(--muted);
  font-size: 13px;
}

body .nav-item:hover {
  color: var(--text);
  background: var(--sidebar-hover);
}

body .nav-item.active {
  color: var(--blue);
  background: rgba(139, 130, 255, 0.14);
}

body .nav-count {
  color: var(--muted);
  background: var(--sidebar-count);
  font-weight: 700;
}

body .nav-item.active .nav-count {
  color: #ffffff;
  background: var(--blue);
}

body .nav-caret {
  color: var(--sidebar-muted);
}

body .admin-nav {
  border-top-color: var(--sidebar-line);
}

body .logout-button {
  border-top: 1px solid var(--sidebar-line);
  padding-top: 11px;
}

body .topbar {
  position: relative;
  z-index: 5;
  align-items: center;
  max-width: 1500px;
  padding: 0;
  border-color: var(--topbar-border);
  background: var(--topbar-surface);
  box-shadow: none;
  margin-right: auto;
  margin-left: auto;
}

body .topbar h1 {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

body .topbar p {
  font-size: 13px;
}

body .current-user {
  margin-left: auto;
  border-color: #242733;
  background: #15161d;
  box-shadow: none;
}

body .current-user-avatar {
  color: #0b0c11;
  background: var(--green);
}

body .current-user-text strong {
  color: var(--text);
}

body .current-user-text small {
  color: var(--muted);
}

body .tab.active {
  max-width: 1500px;
  margin-right: auto;
  margin-left: auto;
}

body .panel-title-row {
  align-items: flex-end;
  margin-bottom: 20px;
}

body .panel-title-row h2 {
  color: #ffffff;
  font-size: 32px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.05;
}

body .panel-title-row p {
  color: var(--sidebar-muted);
  font-size: 16px;
}

body .bk-summary {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

body .bk-summary.compact {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

body .stat {
  padding: 18px 20px;
  border-color: var(--line);
  border-radius: 16px;
  background: #15161d;
  box-shadow: var(--shadow);
}

body .stat span {
  color: var(--sidebar-muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

body .stat strong {
  margin-top: 7px;
  color: #ffffff;
  font-size: 32px;
  font-weight: 850;
  letter-spacing: 0;
}

body .stat small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

body #bkTenderCreatedTodayStat {
  color: var(--green);
}

body .due-stat strong {
  color: var(--red);
}

body .optional-stat {
  display: none;
}

body .bk-filter-card.active {
  border-color: rgba(139, 130, 255, 0.54);
  background: rgba(139, 130, 255, 0.12);
}

body .toolbar {
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  margin-bottom: 20px;
}

body .toolbar input,
body .toolbar select {
  min-height: 44px;
  border-color: #272a35;
  border-radius: 999px;
  color: #d8d9e6;
  background: #181922;
  font-weight: 700;
}

body .toolbar input:focus,
body .toolbar select:focus {
  border-color: var(--blue);
}

body .segment-switch {
  border-color: #272a35;
  background: #15161d;
  box-shadow: var(--shadow);
}

body .segment-switch button.active {
  background: var(--blue);
}

body .bk-table {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

body .bk-table-row {
  grid-template-columns: 64px minmax(0, 1fr) 300px 210px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #15161d;
  box-shadow: none;
}

body .bk-lead-row {
  grid-template-columns: 64px minmax(300px, 1.15fr) minmax(230px, 0.8fr) minmax(280px, 1fr) 120px 126px;
}

body .bk-table-row:last-child {
  border-bottom: 0;
}

body .bk-table-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--sidebar-muted);
  background: #20232d;
  font-size: 13px;
  letter-spacing: 0.08em;
}

body .bk-table-row:not(.bk-table-head):hover {
  border-color: transparent;
  background: #181a23;
  box-shadow: none;
}

body .bk-score {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 16px;
}

body .bk-main-cell strong,
body .bk-table-row strong {
  color: #f4f5fb;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.42;
}

body .bk-table-row span,
body .bk-table-row a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

body .theme-pills {
  margin-top: 7px;
}

body .key-pill {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 13px;
}

body .key-pill.main-theme {
  color: #bab5ff;
  background: rgba(139, 130, 255, 0.12);
}

body .key-pill.secondary-theme,
body .advance-pill {
  color: #b9bdcc;
  background: rgba(255, 255, 255, 0.06);
}

body .advance-pill.yes,
body .bitrix-pill {
  color: var(--green);
  background: rgba(65, 224, 138, 0.12);
}

body .bk-actions {
  gap: 8px;
  justify-content: flex-end;
}

body .bk-actions .button {
  min-height: 38px;
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: none;
  box-shadow: none;
}

body .button {
  border-color: #343746;
  color: #f0f1f7;
  background: #171922;
}

body .button.primary {
  border-color: #8c83ff;
  color: #ffffff;
  background: #8177f4;
  box-shadow: none;
}

body .button.primary:hover {
  border-color: #9a92ff;
  background: #8c83ff;
}

body .button.ghost {
  border-color: #343746;
  color: #eef0f8;
  background: #11131a;
}

body .button.ghost:hover {
  border-color: #4b5062;
  background: #1a1d27;
}

body .score.grade-a {
  color: var(--green);
  background: rgba(25, 112, 62, 0.34);
}

body .score.grade-b {
  color: #f1b950;
  background: rgba(128, 79, 12, 0.36);
}

body .score.grade-c {
  color: #f49a5a;
  background: rgba(134, 74, 18, 0.34);
}

body .score.grade-d {
  color: #b8bdca;
  background: #2a2d38;
}

body .bk-row-links {
  gap: 8px 16px;
}

body .bk-row-links a,
body .bk-row-links span {
  display: inline-flex;
  align-items: center;
  margin-top: 0;
  color: #bab5ff;
  font-size: 13px;
  font-weight: 800;
}

body .bk-deadline-amount-head {
  gap: 6px;
}

body .bk-deadline-amount-head .bk-sort-head {
  color: inherit;
}

body .bk-deadline-amount-cell {
  justify-items: start;
  gap: 8px;
}

body .bk-amount {
  color: #ffffff;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.1;
}

body .deadline-pill {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  margin-bottom: 4px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

body .bk-table-row .deadline-pill .deadline-clock {
  display: block;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  margin: 0;
}

body .bk-table-row .deadline-pill > span {
  display: inline;
  flex: 0 0 auto;
  min-width: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  line-height: 1;
  overflow-wrap: normal;
  white-space: nowrap;
}

body .deadline-pill.today {
  color: #ff6a80;
  background: rgba(255, 97, 119, 0.14);
}

body .deadline-pill.tomorrow,
body .deadline-pill.soon {
  color: #f4b44e;
  background: rgba(244, 180, 78, 0.14);
}

body .deadline-pill.later,
body .deadline-pill.unknown {
  color: #b6bdcf;
  background: rgba(143, 151, 170, 0.12);
}

body .deadline-pill.expired {
  color: #8f96a8;
  background: rgba(143, 151, 170, 0.1);
}

body .advance-pill {
  margin-top: 0;
  border-radius: 999px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 800;
}

body .advance-pill.yes {
  color: var(--green);
  background: transparent;
}

body .status-pill {
  border-radius: 999px;
  color: #b9bdcc;
  background: rgba(255, 255, 255, 0.07);
}

body .bk-table-row .bitrix-pill {
  color: var(--green);
  background: rgba(65, 224, 138, 0.12);
}

body .bk-main-cell {
  gap: 6px;
}

body .bk-main-cell > strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

body .bk-main-cell > span {
  letter-spacing: 0.02em;
}

body .bk-table-row:not(.bk-table-head) > div:nth-child(3) strong {
  font-size: 16px;
}

body .bk-table-row:not(.bk-table-head) > div:nth-child(3) span {
  font-size: 13px;
}

body .bk-table-row:not(.bk-table-head) > div:nth-child(3) span:last-child {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body .bk-contacts {
  margin-top: 8px;
}

body .bk-contacts summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #bab5ff;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

body .bk-contacts summary::-webkit-details-marker {
  display: none;
}

body .bk-contacts summary::before {
  content: "›";
  color: #bab5ff;
  font-size: 18px;
  line-height: 1;
  transition: transform 160ms ease;
}

body .bk-contacts[open] summary::before {
  transform: rotate(90deg);
}

body .bk-contact-list {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}

body .bk-contact-card {
  padding: 9px 10px;
  border: 1px solid #272a35;
  border-radius: 10px;
  background: #1c1e27;
}

body .bk-contact-card strong {
  color: #f4f5fb;
  font-size: 13px;
  font-weight: 800;
}

body .bk-contact-card span,
body .bk-contact-card a {
  margin-top: 3px;
  font-size: 12px;
}

html[data-theme="light"] body {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f2f3f7;
  --surface-hover: #f8f8fc;
  --text: #16181d;
  --muted: #5b6070;
  --line: #e7e9ef;
  --blue: #5b5bd6;
  --blue-dark: #4c4cc4;
  --green: #1b9e5a;
  --amber: #b97d10;
  --red: #d6455b;
  --teal: #5b5bd6;
  --shadow: 0 4px 16px rgba(20, 22, 40, 0.07);
  --sidebar-bg: #ffffff;
  --sidebar-text: #16181d;
  --sidebar-muted: #9298a8;
  --sidebar-line: #e7e9ef;
  --sidebar-hover: #f2f3f7;
  --sidebar-count: #f2f3f7;
  --focus-ring: rgba(91, 91, 214, 0.16);
}

html[data-theme="light"] body .nav {
  scrollbar-color: #d9dce5 transparent;
}

html[data-theme="light"] body .nav::-webkit-scrollbar-thumb {
  background: #d9dce5;
}

html[data-theme="light"] body .nav-item.active {
  color: #4a4ac0;
  background: #eeeefb;
}

html[data-theme="light"] body .panel-title-row h2,
html[data-theme="light"] body .bk-main-cell strong,
html[data-theme="light"] body .bk-table-row strong,
html[data-theme="light"] body .brand strong {
  color: #16181d;
}

html[data-theme="light"] body .topbar h1,
html[data-theme="light"] body .topbar p,
html[data-theme="light"] body .panel-title-row p {
  color: #5b6070;
}

html[data-theme="light"] body .current-user {
  border-color: #e1e4ec;
  background: #ffffff;
}

html[data-theme="light"] body .current-user-avatar {
  color: #ffffff;
  background: #5b5bd6;
}

html[data-theme="light"] body .stat,
html[data-theme="light"] body .bk-table-row {
  background: #ffffff;
}

html[data-theme="light"] body .stat strong,
html[data-theme="light"] body .bk-amount {
  color: #16181d;
}

html[data-theme="light"] body .bk-table-head {
  color: #9298a8;
  background: #f2f3f7;
}

html[data-theme="light"] body .bk-table-row:not(.bk-table-head):hover {
  background: #f8f8fc;
}

html[data-theme="light"] body .toolbar input,
html[data-theme="light"] body .toolbar select {
  border-color: #e7e9ef;
  color: #16181d;
  background: #ffffff;
}

html[data-theme="light"] body .segment-switch {
  border-color: #e7e9ef;
  background: #ffffff;
}

html[data-theme="light"] body .segment-switch button {
  color: #5b6070;
}

html[data-theme="light"] body .segment-switch button:hover {
  color: #16181d;
  background: #f8f8fc;
}

html[data-theme="light"] body .segment-switch button.active {
  color: #ffffff;
  background: #5b5bd6;
}

html[data-theme="light"] body .bk-filter-card.active {
  border-color: rgba(91, 91, 214, 0.34);
  background: #eeeefb;
}

html[data-theme="light"] body .key-pill.main-theme {
  color: #4a4ac0;
  background: #eeeefb;
}

html[data-theme="light"] body .key-pill.secondary-theme {
  color: #5b6070;
  background: #f2f3f7;
}

html[data-theme="light"] body .score.grade-a {
  color: #1b9e5a;
  background: #e3f6ec;
}

html[data-theme="light"] body .score.grade-b {
  color: #b97d10;
  background: #fbf1dc;
}

html[data-theme="light"] body .score.grade-c {
  color: #b97d10;
  background: #fff0cf;
}

html[data-theme="light"] body .score.grade-d {
  color: #9298a8;
  background: #f2f3f7;
}

html[data-theme="light"] body .bk-row-links a,
html[data-theme="light"] body .bk-row-links span,
html[data-theme="light"] body .bk-contacts summary,
html[data-theme="light"] body .bk-contacts summary::before {
  color: #4a4ac0;
}

html[data-theme="light"] body .deadline-pill.today {
  color: #d6455b;
  background: #fbe9ec;
}

html[data-theme="light"] body .deadline-pill.tomorrow,
html[data-theme="light"] body .deadline-pill.soon {
  color: #b97d10;
  background: #fbf1dc;
}

html[data-theme="light"] body .deadline-pill.later,
html[data-theme="light"] body .deadline-pill.unknown,
html[data-theme="light"] body .deadline-pill.expired {
  color: #5b6070;
  background: #f2f3f7;
}

html[data-theme="light"] body .advance-pill {
  color: #5b6070;
}

html[data-theme="light"] body .advance-pill.yes,
html[data-theme="light"] body .bk-table-row .bitrix-pill,
html[data-theme="light"] body .bitrix-pill {
  color: #1b9e5a;
  background: #e3f6ec;
}

html[data-theme="light"] body .status-pill {
  color: #5b6070;
  background: #f2f3f7;
}

html[data-theme="light"] body .button {
  border-color: #d9dce5;
  color: #16181d;
  background: #ffffff;
}

html[data-theme="light"] body .button.primary {
  border-color: #5b5bd6;
  color: #ffffff;
  background: #5b5bd6;
}

html[data-theme="light"] body .button.primary:hover {
  border-color: #4c4cc4;
  background: #4c4cc4;
}

html[data-theme="light"] body .button.ghost {
  border-color: #d9dce5;
  color: #16181d;
  background: #ffffff;
}

html[data-theme="light"] body .button.ghost:hover {
  border-color: #bfc4d1;
  background: #f8f8fc;
}

html[data-theme="light"] body .bk-contact-card {
  border-color: #e7e9ef;
  background: #f8f8fc;
}

html[data-theme="light"] body .bk-contact-card strong {
  color: #16181d;
}

/* ============ ИНФОРМАТИВНЫЙ ДАШБОРД ============ */
body #dashboard {
  position: relative;
  isolation: isolate;
  max-width: 1540px;
  min-height: calc(100vh - 150px);
  padding: 26px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(34, 43, 56, 0.94), rgba(14, 16, 22, 0.98) 48%, rgba(43, 46, 66, 0.92)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 76px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

body #dashboard::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(120deg, rgba(140, 140, 242, 0.12), transparent 36%),
    linear-gradient(290deg, rgba(61, 209, 134, 0.08), transparent 35%);
  opacity: 0.9;
  pointer-events: none;
}

body #dashboard .dashboard-title,
body #dashboard .stats,
body #dashboard .dashboard-layout {
  max-width: none;
}

body #dashboard .dashboard-title {
  align-items: flex-start;
  margin-bottom: 22px;
}

body #dashboard .dashboard-title h2 {
  color: #ffffff;
  font-size: 34px;
}

body #dashboard .dashboard-title p,
body #dashboard .dashboard-title > span {
  color: rgba(239, 242, 249, 0.68);
}

body #dashboard .stats {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

body #dashboard .dashboard-stat,
body #dashboard .panel {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(22px);
}

body #dashboard .dashboard-stat {
  min-height: 118px;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

body #dashboard .dashboard-stat:hover {
  border-color: rgba(140, 140, 242, 0.55);
  background: rgba(255, 255, 255, 0.11);
}

body #dashboard .dashboard-stat span,
body #dashboard .panel h2,
body #dashboard .dashboard-split h3 {
  color: rgba(239, 242, 249, 0.64);
}

body #dashboard .dashboard-stat strong {
  color: #ffffff;
  font-size: 30px;
}

body #dashboard .dashboard-stat small {
  color: rgba(239, 242, 249, 0.62);
}

body #dashboard .dashboard-stat.tone-green strong,
body #dashboard .dashboard-stat.tone-green small {
  color: #5ce59d;
}

body #dashboard .dashboard-stat.tone-amber strong,
body #dashboard .dashboard-stat.tone-amber small {
  color: #f4c15f;
}

body #dashboard .dashboard-stat.tone-red strong,
body #dashboard .dashboard-stat.tone-red small {
  color: #ff6d84;
}

body #dashboard .dashboard-stat.tone-blue strong,
body #dashboard .dashboard-stat.tone-blue small {
  color: #8fbbff;
}

body #dashboard .dashboard-stat.tone-purple strong,
body #dashboard .dashboard-stat.tone-purple small {
  color: #c6a7ff;
}

body #dashboard .dashboard-layout {
  grid-template-columns: minmax(0, 1.12fr) minmax(390px, 0.88fr);
  gap: 18px;
}

body #dashboard .panel {
  padding: 18px;
  border-radius: 22px;
}

body #dashboard .panel-head {
  margin-bottom: 16px;
}

body #dashboard .panel-head h2 {
  font-size: 16px;
  font-weight: 850;
}

body #dashboard .dashboard-overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

body #dashboard .dashboard-ratio-card,
body #dashboard .dashboard-problem,
body #dashboard .dashboard-import-grid > div {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.07);
}

body #dashboard .dashboard-ratio-card strong,
body #dashboard .dashboard-problem strong,
body #dashboard .dashboard-import-head strong,
body #dashboard .dashboard-import-grid strong,
body #dashboard .dashboard-mini-bar > div:first-child {
  color: #ffffff;
}

body #dashboard .dashboard-ratio-card span,
body #dashboard .dashboard-ratio-card small,
body #dashboard .dashboard-problem span,
body #dashboard .dashboard-import-head span,
body #dashboard .dashboard-import-grid span,
body #dashboard .dashboard-mini-bar b {
  color: rgba(239, 242, 249, 0.62);
}

body #dashboard .dashboard-ratio-card small,
body #dashboard .dashboard-theme-strip span {
  color: #bab5ff;
}

body #dashboard .dashboard-ratio-card.tone-green {
  background: rgba(61, 209, 134, 0.1);
}

body #dashboard .dashboard-ratio-card.tone-green strong,
body #dashboard .dashboard-ratio-card.tone-green small {
  color: #5ce59d;
}

body #dashboard .dashboard-ratio-card.tone-amber {
  background: rgba(244, 193, 95, 0.1);
}

body #dashboard .dashboard-ratio-card.tone-amber strong,
body #dashboard .dashboard-ratio-card.tone-amber small {
  color: #f4c15f;
}

body #dashboard .dashboard-ratio-card.tone-red {
  background: rgba(255, 109, 132, 0.1);
}

body #dashboard .dashboard-ratio-card.tone-red strong,
body #dashboard .dashboard-ratio-card.tone-red small {
  color: #ff6d84;
}

body #dashboard .dashboard-ratio-card.tone-blue {
  background: rgba(143, 187, 255, 0.1);
}

body #dashboard .dashboard-ratio-card.tone-blue strong,
body #dashboard .dashboard-ratio-card.tone-blue small {
  color: #8fbbff;
}

body #dashboard .dashboard-ratio-card.tone-purple {
  background: rgba(198, 167, 255, 0.1);
}

body #dashboard .dashboard-ratio-card.tone-purple strong,
body #dashboard .dashboard-ratio-card.tone-purple small {
  color: #c6a7ff;
}

body #dashboard .dashboard-visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(250px, 0.85fr);
  gap: 14px;
}

body #dashboard .dashboard-chart-card {
  min-height: 220px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.065);
}

body #dashboard .dashboard-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

body #dashboard .dashboard-chart-head strong {
  color: #ffffff;
  font-size: 15px;
  font-weight: 850;
}

body #dashboard .dashboard-chart-head span {
  color: rgba(239, 242, 249, 0.55);
  font-size: 12px;
  font-weight: 750;
}

body #dashboard .dashboard-bars {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  min-height: 168px;
}

body #dashboard .dashboard-bar-item {
  display: grid;
  justify-items: center;
  gap: 7px;
}

body #dashboard .dashboard-bar-track {
  display: flex;
  align-items: flex-end;
  width: 100%;
  max-width: 52px;
  height: 112px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

body #dashboard .dashboard-bar-track span {
  display: block;
  width: 100%;
  min-height: 8px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(140, 140, 242, 0.98), rgba(61, 209, 134, 0.86));
}

body #dashboard .dashboard-bar-item.today .dashboard-bar-track span {
  background: linear-gradient(180deg, #ff7087, #bc304b);
}

body #dashboard .dashboard-bar-item.tomorrow .dashboard-bar-track span,
body #dashboard .dashboard-bar-item.soon .dashboard-bar-track span {
  background: linear-gradient(180deg, #f4c15f, #bb7d1b);
}

body #dashboard .dashboard-bar-item strong {
  color: #ffffff;
  font-size: 15px;
  font-weight: 850;
}

body #dashboard .dashboard-bar-item small {
  color: rgba(239, 242, 249, 0.57);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

body #dashboard .dashboard-donut-card {
  display: grid;
}

body #dashboard .dashboard-donut-wrap {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
}

body #dashboard .dashboard-donut-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  color: rgba(239, 242, 249, 0.65);
  font-size: 12px;
  font-weight: 750;
}

body #dashboard .dashboard-donut-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body #dashboard .dashboard-donut-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

body #dashboard .legend-good {
  background: linear-gradient(135deg, #30c3f2, #f4d03f);
}

body #dashboard .legend-rest {
  background: rgba(255, 255, 255, 0.18);
}

body #dashboard .bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

body #dashboard .bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8c8cf2, #47d48d);
}

body #dashboard .dashboard-theme-strip span {
  border: 1px solid rgba(186, 181, 255, 0.2);
  background: rgba(140, 140, 242, 0.12);
}

html[data-theme="light"] body #dashboard {
  border-color: rgba(110, 118, 140, 0.16);
  background:
    linear-gradient(135deg, rgba(239, 245, 255, 0.98), rgba(249, 250, 252, 0.98) 52%, rgba(235, 242, 255, 0.98)),
    repeating-linear-gradient(90deg, rgba(91, 91, 214, 0.035) 0 1px, transparent 1px 76px);
  box-shadow: 0 24px 70px rgba(20, 22, 40, 0.08);
}

html[data-theme="light"] body #dashboard::before {
  background:
    linear-gradient(120deg, rgba(91, 91, 214, 0.12), transparent 36%),
    linear-gradient(290deg, rgba(27, 158, 90, 0.08), transparent 35%);
}

html[data-theme="light"] body #dashboard .dashboard-title h2,
html[data-theme="light"] body #dashboard .dashboard-stat strong,
html[data-theme="light"] body #dashboard .dashboard-ratio-card strong,
html[data-theme="light"] body #dashboard .dashboard-problem strong,
html[data-theme="light"] body #dashboard .dashboard-import-head strong,
html[data-theme="light"] body #dashboard .dashboard-import-grid strong,
html[data-theme="light"] body #dashboard .dashboard-mini-bar > div:first-child,
html[data-theme="light"] body #dashboard .dashboard-chart-head strong,
html[data-theme="light"] body #dashboard .dashboard-bar-item strong {
  color: #16181d;
}

html[data-theme="light"] body #dashboard .dashboard-title p,
html[data-theme="light"] body #dashboard .dashboard-title > span,
html[data-theme="light"] body #dashboard .dashboard-stat span,
html[data-theme="light"] body #dashboard .dashboard-stat small,
html[data-theme="light"] body #dashboard .panel h2,
html[data-theme="light"] body #dashboard .dashboard-split h3,
html[data-theme="light"] body #dashboard .dashboard-ratio-card span,
html[data-theme="light"] body #dashboard .dashboard-ratio-card small,
html[data-theme="light"] body #dashboard .dashboard-problem span,
html[data-theme="light"] body #dashboard .dashboard-import-head span,
html[data-theme="light"] body #dashboard .dashboard-import-grid span,
html[data-theme="light"] body #dashboard .dashboard-mini-bar b,
html[data-theme="light"] body #dashboard .dashboard-chart-head span,
html[data-theme="light"] body #dashboard .dashboard-bar-item small {
  color: #5b6070;
}

html[data-theme="light"] body #dashboard .dashboard-stat,
html[data-theme="light"] body #dashboard .panel {
  border-color: rgba(110, 118, 140, 0.15);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 44px rgba(20, 22, 40, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

html[data-theme="light"] body #dashboard .dashboard-ratio-card,
html[data-theme="light"] body #dashboard .dashboard-problem,
html[data-theme="light"] body #dashboard .dashboard-import-grid > div,
html[data-theme="light"] body #dashboard .dashboard-chart-card {
  border-color: rgba(110, 118, 140, 0.14);
  background: rgba(255, 255, 255, 0.66);
}

html[data-theme="light"] body #dashboard .dashboard-donut-legend {
  color: #5b6070;
}

html[data-theme="light"] body #dashboard .dashboard-stat.tone-green strong,
html[data-theme="light"] body #dashboard .dashboard-stat.tone-green small,
html[data-theme="light"] body #dashboard .dashboard-ratio-card.tone-green strong,
html[data-theme="light"] body #dashboard .dashboard-ratio-card.tone-green small {
  color: #1b9e5a;
}

html[data-theme="light"] body #dashboard .dashboard-stat.tone-amber strong,
html[data-theme="light"] body #dashboard .dashboard-stat.tone-amber small,
html[data-theme="light"] body #dashboard .dashboard-ratio-card.tone-amber strong,
html[data-theme="light"] body #dashboard .dashboard-ratio-card.tone-amber small {
  color: #b97d10;
}

html[data-theme="light"] body #dashboard .dashboard-stat.tone-red strong,
html[data-theme="light"] body #dashboard .dashboard-stat.tone-red small,
html[data-theme="light"] body #dashboard .dashboard-ratio-card.tone-red strong,
html[data-theme="light"] body #dashboard .dashboard-ratio-card.tone-red small {
  color: #d6455b;
}

html[data-theme="light"] body #dashboard .dashboard-stat.tone-blue strong,
html[data-theme="light"] body #dashboard .dashboard-stat.tone-blue small,
html[data-theme="light"] body #dashboard .dashboard-ratio-card.tone-blue strong,
html[data-theme="light"] body #dashboard .dashboard-ratio-card.tone-blue small {
  color: #4a4ac0;
}

html[data-theme="light"] body #dashboard .dashboard-stat.tone-purple strong,
html[data-theme="light"] body #dashboard .dashboard-stat.tone-purple small,
html[data-theme="light"] body #dashboard .dashboard-ratio-card.tone-purple strong,
html[data-theme="light"] body #dashboard .dashboard-ratio-card.tone-purple small {
  color: #7a4bd8;
}

html[data-theme="light"] body #dashboard .dashboard-ratio-card.tone-green {
  background: rgba(27, 158, 90, 0.08);
}

html[data-theme="light"] body #dashboard .dashboard-ratio-card.tone-amber {
  background: rgba(185, 125, 16, 0.08);
}

html[data-theme="light"] body #dashboard .dashboard-ratio-card.tone-red {
  background: rgba(214, 69, 91, 0.08);
}

html[data-theme="light"] body #dashboard .dashboard-ratio-card.tone-blue,
html[data-theme="light"] body #dashboard .dashboard-ratio-card.tone-purple {
  background: rgba(91, 91, 214, 0.08);
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .nav {
    overflow: visible;
  }

  .layout.two,
  .stats,
  .service-client-grid,
  .dashboard-import-grid {
    grid-template-columns: 1fr;
  }

  body #dashboard .stats,
  body #dashboard .dashboard-layout,
  body #dashboard .dashboard-visual-grid,
  body #dashboard .dashboard-overview-grid,
  body #dashboard .dashboard-split,
  body #dashboard .dashboard-import-grid {
    grid-template-columns: 1fr;
  }

  .commercial-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .queue-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-row {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .table-row.header {
    display: none;
  }

  .table-row > *:nth-child(n + 3) {
    grid-column: 2;
  }

  .bk-summary {
    grid-template-columns: 1fr;
  }

  .bk-table-row,
  .bk-lead-row,
  .dashboard-overview-grid,
  .dashboard-split {
    grid-template-columns: 1fr;
  }

  .bk-table-head {
    display: none;
  }

  .bk-actions {
    justify-content: flex-start;
  }

  .duplicate-lead-row,
  .duplicate-tender-row,
  .similar-row,
  .tender-focus-note {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .top-actions,
  .scope-controls,
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .source-grid,
  .procurement-query,
  .platform-row {
    grid-template-columns: 1fr;
  }

  .platform-meta {
    justify-content: flex-start;
  }

  .tender-money-summary,
  .tender-money-grid,
  .queue-summary {
    grid-template-columns: 1fr;
  }

  .lead-card {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .lead-card .button {
    grid-column: 1 / -1;
  }
}

/* Уважение к reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ============ ЭМБЛЕМА-ИЗОЛИНИИ В САЙДБАРЕ ============ */
.brand .logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.brand .logo-mark circle,
.brand .logo-mark path {
  transform-origin: 24px 24px;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand:hover .logo-mark path:first-of-type {
  transform: rotate(8deg);
}

.brand:hover .logo-mark path:last-of-type {
  transform: rotate(-6deg);
}

/* ============ АНИМАЦИИ И МИКРОВЗАИМОДЕЙСТВИЯ ============ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Каскадное появление при загрузке (только активная вкладка) */
.tab.active .panel-title-row {
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tab.active .bk-summary .stat {
  animation: fadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tab.active .bk-summary .stat:nth-child(1) { animation-delay: 0.04s; }
.tab.active .bk-summary .stat:nth-child(2) { animation-delay: 0.08s; }
.tab.active .bk-summary .stat:nth-child(3) { animation-delay: 0.12s; }
.tab.active .bk-summary .stat:nth-child(4) { animation-delay: 0.16s; }
.tab.active .bk-summary .stat:nth-child(5) { animation-delay: 0.2s; }
.tab.active .bk-summary .stat:nth-child(6) { animation-delay: 0.24s; }

.tab.active .toolbar,
.tab.active .segment-switch {
  animation: fadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

.tab.active .bk-table,
.tab.active .lead-table,
.tab.active .dashboard-layout {
  animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.18s both;
}

/* Карточки статистики приподнимаются */
.stat {
  transition:
    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.2s,
    border-color 0.15s,
    background 0.15s;
}

.stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Строки списка: акцентная полоска слева при наведении */
.bk-table-row {
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.bk-table-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  transform: scaleY(0);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.bk-table-row:hover {
  background: var(--surface-hover);
}

.bk-table-row:hover::before {
  transform: scaleY(1);
}

/* Бейдж оценки слегка увеличивается */
.bk-score {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bk-table-row:hover .bk-score {
  transform: scale(1.07);
}

/* Нажатие кнопок и чипов — пружинка + ripple */
.button,
.bk-actions button,
.bk-filter-card,
.segment-switch button {
  position: relative;
  overflow: hidden;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s,
    transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s;
}

.button:active,
.bk-actions button:active,
.segment-switch button:active {
  transform: scale(0.95);
}

.bk-filter-card:active {
  transform: scale(0.98);
}

.button.primary:hover {
  box-shadow: 0 5px 16px color-mix(in srgb, var(--accent) 35%, transparent);
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.16;
  transform: scale(0);
  animation: rippleGrow 0.5s ease-out forwards;
  pointer-events: none;
}

@keyframes rippleGrow {
  to {
    transform: scale(3);
    opacity: 0;
  }
}

/* Контакты раскрываются каскадом */
.bk-contacts[open] .bk-contact-card {
  animation: fadeUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.bk-contacts[open] .bk-contact-card:nth-child(2) { animation-delay: 0.05s; }
.bk-contacts[open] .bk-contact-card:nth-child(3) { animation-delay: 0.1s; }
.bk-contacts[open] .bk-contact-card:nth-child(4) { animation-delay: 0.15s; }

/* Иконка темы подмигивает */
.theme-toggle .theme-toggle-icon {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle:hover .theme-toggle-icon {
  transform: rotate(20deg);
}

/* ============ ФИРМЕННЫЕ ПУСТЫЕ СОСТОЯНИЯ ============ */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 64px 0;
  border: none;
  border-radius: 0;
  text-align: center;
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.empty .empty-mark {
  width: 64px;
  height: 64px;
  opacity: 0.45;
  margin-bottom: 10px;
}

.empty .empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-2);
}

.empty .empty-hint {
  font-size: 0.85rem;
  color: var(--text-3);
}

/* ============================================================
   КОНТУР 2.0 — ФИНАЛЬНАЯ ПОЛИРОВКА
   Блок идёт последним и приводит все компоненты к единой
   дизайн-системе. Только визуал, классы и логика не тронуты.
   ============================================================ */

/* ---------- Сайдбар ---------- */
html[data-theme] body .shell { grid-template-columns: 248px minmax(0, 1fr); }
html[data-theme] body .sidebar {
  gap: 16px;
  padding: 20px 12px;
  border-right: 1px solid var(--border);
}
html[data-theme] body .brand { gap: 10px; padding: 2px 10px 0; }
html[data-theme] body .brand .logo-mark { width: 36px; height: 36px; }
html[data-theme] body .brand strong { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
html[data-theme] body .brand small { font-size: 0.7rem; font-weight: 500; color: var(--text-3); }
html[data-theme] body .nav { gap: 2px; scrollbar-color: var(--border-strong) transparent; }
html[data-theme] body .nav::-webkit-scrollbar-thumb { background: var(--border-strong); }
html[data-theme] body .nav-item {
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
html[data-theme] body .nav-item:hover { background: var(--surface-2); color: var(--text); }
html[data-theme] body .nav-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
html[data-theme] body .nav-item.sub { padding: 7px 10px; font-size: 0.84rem; color: var(--text-3); }
html[data-theme] body .nav-item.sub:hover { color: var(--text); }
html[data-theme] body .nav-item.sub.active { color: var(--accent-text); }
html[data-theme] body .nav-count {
  min-width: auto;
  padding: 1px 8px;
  color: var(--text-3);
  background: var(--surface-2);
  font-size: 0.72rem;
  font-weight: 600;
}
html[data-theme] body .nav-item.active .nav-count { color: #fff; background: var(--accent); }
html[data-theme] body .nav-section-title {
  padding: 14px 10px 4px;
  color: var(--text-3);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
}
html[data-theme] body .nav-caret { color: var(--text-3); }
html[data-theme] body .admin-nav { border-top: 1px solid var(--border); }
html[data-theme] body .theme-toggle {
  min-height: 38px;
  border: none;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 500;
}
html[data-theme] body .theme-toggle:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Топбар: компактный ---------- */
html[data-theme] body .topbar {
  align-items: center;
  padding: 12px 18px;
  margin-bottom: 20px;
  border-radius: 12px;
}
html[data-theme] body .topbar h1 { margin: 0; font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; }
html[data-theme] body .topbar p { margin: 2px 0 0; color: var(--text-3); font-size: 0.78rem; }
html[data-theme] body .current-user-avatar {
  background: linear-gradient(135deg, #e8945a, #d65b8a);
  font-weight: 700;
}

/* ---------- Заголовки страниц ---------- */
html[data-theme] body .panel-title-row { margin-bottom: 18px; }
html[data-theme] body .panel-title-row h2 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; }
html[data-theme] body .panel-title-row p { margin-top: 4px; color: var(--text-3); font-size: 0.85rem; }
html[data-theme] body .panel-title-row > span {
  padding: 4px 10px;
  color: var(--text-2);
  background: var(--surface-2);
  font-size: 0.78rem;
  font-weight: 600;
}

/* ---------- Кнопки ---------- */
html[data-theme] body .button {
  min-height: 38px;
  border-radius: 9px;
  color: var(--text-2);
  font-size: 0.86rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.2s,
    transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1);
}
html[data-theme] body .button:hover { background: var(--surface-2); color: var(--text); }
html[data-theme] body .button:active { transform: scale(0.96); }
html[data-theme] body .button.primary { border-color: var(--accent); color: #fff; background: var(--accent); }
html[data-theme] body .button.primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 5px 16px color-mix(in srgb, var(--accent) 35%, transparent);
}
html[data-theme] body .button.danger { border-color: transparent; color: var(--red); background: var(--red-soft); }
html[data-theme] body .icon-button { color: var(--text-2); background: var(--surface-2); border-radius: 8px; }
html[data-theme] body .icon-button:hover { color: var(--text); }

/* ---------- Карточки статистики ---------- */
html[data-theme] body .stat {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
html[data-theme] body .stat span {
  color: var(--text-3);
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
html[data-theme] body .stat strong { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
html[data-theme] body .stat small { color: var(--text-3); font-size: 0.75rem; }
html[data-theme] body .due-stat strong { color: var(--red); }
html[data-theme] body .bk-filter-card:hover { border-color: var(--border-strong); background: var(--surface); }
html[data-theme] body .bk-filter-card.active {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- Тулбар: поиск и фильтры ---------- */
html[data-theme] body .toolbar { flex-wrap: wrap; margin-bottom: 16px; }
html[data-theme] body .toolbar input,
html[data-theme] body .toolbar select,
html[data-theme] body .scope-controls select,
html[data-theme] body dialog input,
html[data-theme] body dialog select,
html[data-theme] body dialog textarea,
html[data-theme] body .user-form input,
html[data-theme] body .user-form select {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  background: var(--surface);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
html[data-theme] body .toolbar input:focus,
html[data-theme] body .toolbar select:focus,
html[data-theme] body dialog input:focus,
html[data-theme] body dialog select:focus,
html[data-theme] body dialog textarea:focus,
html[data-theme] body .user-form input:focus,
html[data-theme] body .user-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
html[data-theme] body .toolbar input[type="search"] { flex: 1 1 260px; }
html[data-theme] body .toolbar input::placeholder { color: var(--text-3); }

/* ---------- Списки БК: единый контейнер ---------- */
html[data-theme] body .bk-table {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
html[data-theme] body .bk-table-row {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  background: var(--surface);
}
html[data-theme] body .bk-table-row:last-child { border-bottom: 0; }
html[data-theme] body .bk-table-row:not(.bk-table-head):hover {
  border-color: var(--border);
  background: var(--surface-hover);
  box-shadow: none;
}
html[data-theme] body .bk-table-head {
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
html[data-theme] body .bk-sort-head:hover,
html[data-theme] body .bk-sort-head.active { color: var(--accent-text); }
html[data-theme] body .bk-table-row strong {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
html[data-theme] body .bk-table-row span { color: var(--text-3); font-size: 0.78rem; }
html[data-theme] body .bk-table-row a { color: var(--accent-text); font-size: 0.8rem; font-weight: 500; }
html[data-theme] body .bk-amount { font-size: 1.02rem; font-weight: 700; color: var(--text); }
html[data-theme] body .bk-actions .button { min-height: 32px; border-radius: 8px; font-size: 0.79rem; }

/* ---------- Оценка ---------- */
html[data-theme] body .score {
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 12px;
  font-size: 0.98rem;
  font-weight: 800;
}
html[data-theme] body .bk-score { width: 46px; height: 46px; }
html[data-theme] body .score.grade-a { color: var(--green); background: var(--green-soft); }
html[data-theme] body .score.grade-b { color: var(--amber); background: var(--amber-soft); }
html[data-theme] body .score.grade-c { color: var(--text-3); background: var(--surface-2); }
html[data-theme] body .score.grade-d { color: var(--red); background: var(--red-soft); }

/* ---------- Пилюли ---------- */
html[data-theme] body .deadline-pill {
  min-height: auto;
  padding: 4px 10px;
  color: var(--text-2);
  background: var(--surface-2);
  font-size: 0.75rem;
  font-weight: 600;
}
html[data-theme] body .deadline-pill.today { color: var(--red); background: var(--red-soft); }
html[data-theme] body .deadline-pill.tomorrow,
html[data-theme] body .deadline-pill.soon { color: var(--amber); background: var(--amber-soft); }
html[data-theme] body .deadline-pill.expired { color: var(--text-3); background: var(--surface-2); }
html[data-theme] body .deadline-pill.later,
html[data-theme] body .deadline-pill.unknown { color: var(--text-2); background: var(--surface-2); }
html[data-theme] body .status-pill {
  border-radius: 6px;
  padding: 3px 9px;
  color: var(--text-2);
  background: var(--surface-2);
  font-size: 0.72rem;
  font-weight: 600;
}
html[data-theme] body .status-pill.bitrix-pill,
html[data-theme] body .bk-table-row .bitrix-pill { color: var(--green); background: var(--green-soft); }
html[data-theme] body .advance-pill {
  padding: 3px 9px;
  color: var(--text-3);
  background: var(--surface-2);
  font-size: 0.72rem;
  font-weight: 600;
}
html[data-theme] body .advance-pill.yes { color: var(--green); background: var(--green-soft); }
html[data-theme] body .key-pill {
  padding: 3px 9px;
  border-radius: 6px;
  color: var(--text-2);
  background: var(--surface-2);
  font-size: 0.72rem;
  font-weight: 600;
}
html[data-theme] body .key-pill.main-theme { color: var(--accent-text); background: var(--accent-soft); }
html[data-theme] body .key-pill.secondary-theme { color: var(--text-2); background: var(--surface-2); }
html[data-theme] body .tag { color: var(--text-2); background: var(--surface-2); border-radius: 6px; font-weight: 600; }
html[data-theme] body .tender-pill.active { color: var(--green); background: var(--green-soft); }
html[data-theme] body .tender-pill.closed,
html[data-theme] body .tender-pill.unknown { color: var(--text-3); background: var(--surface-2); }
html[data-theme] body .tender-pill.law { color: var(--accent-text); background: var(--accent-soft); }

/* ---------- Контакты ---------- */
html[data-theme] body .bk-contacts summary {
  color: var(--accent-text);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}
html[data-theme] body .bk-contact-card {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 0.78rem;
}
html[data-theme] body .bk-contact-card strong { font-size: 0.8rem; }

/* ---------- Сегмент-переключатели ---------- */
html[data-theme] body .segment-switch button {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.15s;
}
html[data-theme] body .segment-switch button.active {
  border-color: transparent;
  color: var(--accent-text);
  background: var(--accent-soft);
  font-weight: 600;
}
html[data-theme] body .segment-count { color: var(--text-3); background: var(--surface-2); }
html[data-theme] body .segment-switch button.active .segment-count { color: #fff; background: var(--accent); }

/* ---------- Панели и диалог ---------- */
html[data-theme] body .panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
html[data-theme] body .panel h2 { font-size: 0.95rem; font-weight: 600; }
html[data-theme] body dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
html[data-theme] body dialog::backdrop { background: rgba(10, 11, 20, 0.45); }

/* ---------- Дашборд: чистый, в теме, без «стекла» ---------- */
html[data-theme] body #dashboard {
  min-height: auto;
  padding: 0;
  overflow: visible;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
html[data-theme] body #dashboard::before { content: none; }
html[data-theme] body #dashboard .dashboard-title h2 {
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
html[data-theme] body #dashboard .dashboard-title p,
html[data-theme] body #dashboard .dashboard-title > span { color: var(--text-3); }
html[data-theme] body #dashboard .stats { gap: 12px; }
html[data-theme] body #dashboard .dashboard-stat,
html[data-theme] body #dashboard .stat {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
}
html[data-theme] body #dashboard .dashboard-stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
html[data-theme] body #dashboard .dashboard-stat span,
html[data-theme] body #dashboard .stat span {
  color: var(--text-3);
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
html[data-theme] body #dashboard .dashboard-stat strong,
html[data-theme] body #dashboard .stat strong { color: var(--text); font-size: 1.35rem; font-weight: 700; }
html[data-theme] body #dashboard .dashboard-stat small,
html[data-theme] body #dashboard .stat small { color: var(--text-3); }
html[data-theme] body #dashboard .dashboard-stat.tone-green strong { color: var(--green); }
html[data-theme] body #dashboard .dashboard-stat.tone-amber strong { color: var(--amber); }
html[data-theme] body #dashboard .dashboard-stat.tone-red strong { color: var(--red); }
html[data-theme] body #dashboard .dashboard-stat.tone-blue strong,
html[data-theme] body #dashboard .dashboard-stat.tone-purple strong { color: var(--accent-text); }
html[data-theme] body #dashboard .dashboard-stat.tone-green small,
html[data-theme] body #dashboard .dashboard-stat.tone-amber small,
html[data-theme] body #dashboard .dashboard-stat.tone-red small,
html[data-theme] body #dashboard .dashboard-stat.tone-blue small,
html[data-theme] body #dashboard .dashboard-stat.tone-purple small { color: var(--text-3); }
html[data-theme] body #dashboard .panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
}
html[data-theme] body #dashboard .panel h2,
html[data-theme] body #dashboard .panel-head h2,
html[data-theme] body #dashboard .dashboard-split h3 { color: var(--text); font-size: 0.95rem; font-weight: 600; }
html[data-theme] body #dashboard .dashboard-ratio-card,
html[data-theme] body #dashboard .dashboard-problem,
html[data-theme] body #dashboard .dashboard-import-grid > div {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
html[data-theme] body #dashboard .dashboard-ratio-card strong,
html[data-theme] body #dashboard .dashboard-problem strong,
html[data-theme] body #dashboard .dashboard-import-head strong,
html[data-theme] body #dashboard .dashboard-import-grid strong,
html[data-theme] body #dashboard .dashboard-chart-head strong,
html[data-theme] body #dashboard .dashboard-bar-item strong,
html[data-theme] body #dashboard .dashboard-mini-bar > div:first-child { color: var(--text); }
html[data-theme] body #dashboard .dashboard-ratio-card span,
html[data-theme] body #dashboard .dashboard-ratio-card small,
html[data-theme] body #dashboard .dashboard-problem span,
html[data-theme] body #dashboard .dashboard-import-head span,
html[data-theme] body #dashboard .dashboard-import-grid span,
html[data-theme] body #dashboard .dashboard-bar-item small,
html[data-theme] body #dashboard .dashboard-mini-bar b,
html[data-theme] body #dashboard .dashboard-theme-strip span,
html[data-theme] body #dashboard .dashboard-donut-legend span { color: var(--text-3); }
html[data-theme] body #dashboard .bar { background: var(--surface-2); border-radius: 999px; }
html[data-theme] body #dashboard .bar span { background: var(--accent); border-radius: 999px; }
html[data-theme] body #dashboard .facts { color: var(--text-2); }

/* ---------- Пустые состояния и прочее ---------- */
html[data-theme] body .empty { border: none; background: transparent; }
html[data-theme] body .muted,
html[data-theme] body .cell-muted { color: var(--text-3); }
html[data-theme] body .audit-item { border-color: var(--border); }
html[data-theme] body .audit-meta { color: var(--text-3); }
html[data-theme] body .form-note { color: var(--text-3); font-size: 0.8rem; }

/* ---------- Фокус с клавиатуры ---------- */
html[data-theme] body .button:focus-visible,
html[data-theme] body .nav-item:focus-visible,
html[data-theme] body .segment-switch button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html[data-theme] body *,
  html[data-theme] body *::before,
  html[data-theme] body *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================================
   КОНТУР 2.1 — иконки меню, луна/солнце, сосуд качества базы
   ============================================================ */

/* ---------- Иконки в меню ---------- */
html[data-theme] body .nav-item {
  justify-content: flex-start;
  gap: 10px;
}
html[data-theme] body .nav-ico {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.85;
}
html[data-theme] body .nav-item > .nav-count,
html[data-theme] body .nav-item > .nav-meta { margin-left: auto; }
html[data-theme] body .nav-item.sub { padding-left: 37px; }

/* ---------- Луна / солнце в переключателе темы ---------- */
html[data-theme] body .theme-toggle .nav-ico {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
html[data-theme] body .theme-toggle:hover .nav-ico { transform: rotate(20deg); }
html[data-theme="dark"] body .theme-toggle .tt-moon { display: none; }
html[data-theme="light"] body .theme-toggle .tt-sun { display: none; }

/* ---------- Сосуд «Качество базы» ---------- */
html[data-theme] body .quality-vessel-wrap {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 8px 0 4px;
}
html[data-theme] body .quality-vessel {
  position: relative;
  width: 150px;
  height: 150px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface-2);
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(20, 22, 40, 0.06);
}
html[data-theme="dark"] body .quality-vessel {
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.35);
}
/* Жидкость: полупрозрачный акцент, поднимается снизу до --fill */
html[data-theme] body .quality-liquid {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--fill, 0%);
  background: linear-gradient(
    to top,
    color-mix(in srgb, var(--accent) 55%, transparent),
    color-mix(in srgb, var(--accent) 28%, transparent)
  );
  animation: vesselRise 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}
@keyframes vesselRise {
  from { height: 0%; }
}
/* Волны на поверхности: два вращающихся «блина» разной скорости */
html[data-theme] body .quality-wave {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 320px;
  height: 320px;
  margin-left: -160px;
  border-radius: 42% 44% 41% 45%;
  background: color-mix(in srgb, var(--accent) 32%, transparent);
  animation: waveSpin 9s linear infinite;
}
html[data-theme] body .quality-wave.w2 {
  border-radius: 45% 41% 44% 42%;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  animation-duration: 13s;
  animation-direction: reverse;
}
@keyframes waveSpin {
  to { transform: rotate(360deg); }
}
/* Подпись по центру */
html[data-theme] body .quality-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  text-align: center;
  z-index: 1;
}
html[data-theme] body .quality-label strong {
  color: var(--text);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
html[data-theme] body .quality-label span {
  color: var(--text-2);
  font-size: 0.72rem;
  font-weight: 600;
}
/* Легенда под сосудом */
html[data-theme] body .quality-vessel-wrap .dashboard-donut-legend .legend-good {
  background: color-mix(in srgb, var(--accent) 45%, transparent);
}
html[data-theme] body .quality-vessel-wrap .dashboard-donut-legend .legend-rest {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
}

/* Reduced motion: сосуд наполняется мгновенно, волны статичны */
@media (prefers-reduced-motion: reduce) {
  html[data-theme] body .quality-liquid { animation: none; }
  html[data-theme] body .quality-wave { animation: none; }
}

/* ============================================================
   КОНТУР 2.2 — ТИПОГРАФИКА И КОМПОНОВКА (как в эталоне)
   ============================================================ */

/* База: 15px как в эталоне — всё становится собраннее */
html { font-size: 15px; }
html[data-theme] body { font-size: 1rem; line-height: 1.5; }

/* Контент по центру, не растягивается на весь монитор */
html[data-theme] body .main {
  width: 100%;
  max-width: 1296px;
  margin: 0 auto;
}

/* Сетка списка тендеров — пропорции эталона */
html[data-theme] body .bk-table-row {
  grid-template-columns: 64px minmax(0, 1.5fr) minmax(0, 0.9fr) 214px;
  gap: 20px;
  padding: 18px 20px;
}
html[data-theme] body .bk-lead-row {
  grid-template-columns: 64px minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr) 118px 128px;
}
html[data-theme] body .bk-table-head { padding: 10px 20px; }
html[data-theme] body .bk-main-cell { gap: 4px; }
html[data-theme] body .bk-row-links { gap: 6px 14px; margin-top: 8px; }
html[data-theme] body .bk-deadline-amount-cell { gap: 8px; }

/* Иерархия текста в строках: название → номер → мета */
html[data-theme] body .bk-table-row strong {
  font-size: 0.95rem;
  line-height: 1.45;
}
html[data-theme] body .bk-main-cell > span:first-of-type {
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}
html[data-theme] body .bk-table-row span { line-height: 1.4; }

/* Цифры — табличные, чтобы суммы и счётчики не «плясали» */
html[data-theme] body .bk-amount,
html[data-theme] body .nav-count,
html[data-theme] body .segment-count,
html[data-theme] body .stat strong,
html[data-theme] body .score,
html[data-theme] body .quality-label strong,
html[data-theme] body .deadline-pill { font-variant-numeric: tabular-nums; }

/* Селекты: аккуратная стрелка вместо системной */
html[data-theme] body .toolbar select,
html[data-theme] body .scope-controls select,
html[data-theme] body dialog select,
html[data-theme] body .user-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239298a8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}
html[data-theme="dark"] body .toolbar select,
html[data-theme="dark"] body .scope-controls select,
html[data-theme="dark"] body dialog select,
html[data-theme="dark"] body .user-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666c7e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* Заголовки панелей и мелкие подписи — единый ритм */
html[data-theme] body .panel-head p { color: var(--text-3); font-size: 0.8rem; }
html[data-theme] body .dashboard-chart-head strong { font-size: 0.92rem; font-weight: 600; }
html[data-theme] body .dashboard-chart-head span { font-size: 0.76rem; }
html[data-theme] body .quality-list li,
html[data-theme] body .score-rules span { font-size: 0.86rem; color: var(--text-2); }
html[data-theme] body .score-rules strong { color: var(--accent-text); font-variant-numeric: tabular-nums; }

html[data-theme] body .score-rules div {
  grid-template-columns: minmax(104px, max-content) minmax(0, 1fr);
  column-gap: 16px;
  align-items: start;
}

html[data-theme] body .score-rules strong {
  display: block;
  min-width: 104px;
  white-space: nowrap;
  line-height: 1.08;
}

html[data-theme] body .score-rules span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

@media (max-width: 520px) {
  html[data-theme] body .score-rules div {
    grid-template-columns: 1fr;
    row-gap: 6px;
  }

  html[data-theme] body .score-rules strong {
    min-width: 0;
  }
}

/* Ссылки в строках — без подчёркивания до наведения */
html[data-theme] body .bk-table-row a { text-decoration: none; }
html[data-theme] body .bk-table-row a:hover { text-decoration: underline; }

html[data-theme] body .bk-action-notice {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.35;
}

html[data-theme] body .bk-action-notice.info {
  border-color: rgba(99, 102, 241, 0.28);
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent-text);
}

html[data-theme] body .bk-action-notice.success {
  border-color: rgba(50, 191, 132, 0.28);
  background: rgba(50, 191, 132, 0.09);
  color: var(--green);
}

html[data-theme] body .bk-action-notice.warning {
  border-color: color-mix(in srgb, var(--amber) 32%, var(--border));
  background: var(--amber-soft);
  color: var(--amber);
}

html[data-theme] body .bk-action-notice.danger {
  border-color: rgba(216, 72, 99, 0.3);
  background: rgba(216, 72, 99, 0.1);
  color: var(--red);
}

/* ============================================================
   КОНТУР 2.3 — ИДЕАЛЬНЫЙ ДАШБОРД
   Иерархия: KPI → визуальный обзор → детали. Семантические тона,
   анимированные бары, живой индикатор обновления.
   ============================================================ */

/* ---------- Сетка ---------- */
html[data-theme] body .dashboard-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}
html[data-theme] body .dash-row-main { grid-template-columns: 2fr 1fr; align-items: start; }
html[data-theme] body .dash-row-secondary { grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 1100px) {
  html[data-theme] body .dash-row-main,
  html[data-theme] body .dash-row-secondary { grid-template-columns: 1fr; }
}
html[data-theme] body #dashboard .stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

/* ---------- KPI-карточки: тоновая полоска слева ---------- */
html[data-theme] body #dashboard .dashboard-stat {
  position: relative;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
}
html[data-theme] body #dashboard .dashboard-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.9;
}
html[data-theme] body #dashboard .dashboard-stat.tone-green::before { background: var(--green); }
html[data-theme] body #dashboard .dashboard-stat.tone-amber::before { background: var(--amber); }
html[data-theme] body #dashboard .dashboard-stat.tone-red::before { background: var(--red); }
html[data-theme] body #dashboard .dashboard-stat.tone-blue::before,
html[data-theme] body #dashboard .dashboard-stat.tone-purple::before { background: var(--accent); }
html[data-theme] body #dashboard .dashboard-stat:hover { border-color: var(--border-strong); }

/* ---------- «Обновлено» с живым пульсом ---------- */
html[data-theme] body #dashboardUpdatedAt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--text-3);
}
html[data-theme] body #dashboardUpdatedAt::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: livePulse 2.2s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 45%, transparent); }
  50% { box-shadow: 0 0 0 5px transparent; }
}

/* ---------- Ratio-карточки: значение + прогресс ---------- */
html[data-theme] body #dashboard .dashboard-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 900px) {
  html[data-theme] body #dashboard .dashboard-overview-grid { grid-template-columns: repeat(2, 1fr); }
}
html[data-theme] body #dashboard .dashboard-ratio-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
}
html[data-theme] body #dashboard .dashboard-ratio-card > span {
  color: var(--text-3);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
html[data-theme] body #dashboard .ratio-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
html[data-theme] body #dashboard .ratio-value strong {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
html[data-theme] body #dashboard .ratio-value small {
  color: var(--text-3);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}
html[data-theme] body #dashboard .ratio-bar {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
html[data-theme] body #dashboard .ratio-bar b {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  animation: growWidth 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}
html[data-theme] body #dashboard .dashboard-ratio-card.tone-green .ratio-bar b { background: var(--green); }
html[data-theme] body #dashboard .dashboard-ratio-card.tone-amber .ratio-bar b { background: var(--amber); }
html[data-theme] body #dashboard .dashboard-ratio-card.tone-red .ratio-bar b { background: var(--red); }
html[data-theme] body #dashboard .dashboard-ratio-card.tone-purple .ratio-bar b,
html[data-theme] body #dashboard .dashboard-ratio-card.tone-blue .ratio-bar b { background: var(--accent); }
@keyframes growWidth { from { width: 0; } }

html[data-theme] body #dashboard .dashboard-bar-item strong { font-variant-numeric: tabular-nums; }

/* ---------- Мини-бары (Тематики / Оценки) ---------- */
html[data-theme] body #dashboard .dashboard-mini-bar { display: grid; gap: 5px; }
html[data-theme] body #dashboard .dashboard-mini-bar > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
}
html[data-theme] body #dashboard .dashboard-mini-bar b { font-variant-numeric: tabular-nums; font-weight: 600; }
html[data-theme] body #dashboard .dashboard-mini-bar .bar {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
html[data-theme] body #dashboard .dashboard-mini-bar .bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  animation: growWidth 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}
html[data-theme] body #dashboard .dashboard-mini-bar.tone-green .bar-fill { background: var(--green); }
html[data-theme] body #dashboard .dashboard-mini-bar.tone-amber .bar-fill { background: var(--amber); }
html[data-theme] body #dashboard .dashboard-mini-bar.tone-red .bar-fill { background: var(--red); }
html[data-theme] body #dashboard .dashboard-mini-bar.tone-gray .bar-fill { background: var(--border-strong); }

/* ---------- Проблемы данных: счётчик-пилюля ---------- */
html[data-theme] body #dashboard .dashboard-problem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
}
html[data-theme] body #dashboard .dashboard-problem strong { font-size: 0.86rem; font-weight: 600; }
html[data-theme] body #dashboard .dashboard-problem span { font-size: 0.75rem; }
html[data-theme] body #dashboard .dashboard-problem b {
  min-width: 34px;
  padding: 3px 10px;
  border-radius: 999px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  background: var(--surface-2);
}
html[data-theme] body #dashboard .dashboard-problem.tone-red b { color: var(--red); background: var(--red-soft); }
html[data-theme] body #dashboard .dashboard-problem.tone-amber b { color: var(--amber); background: var(--amber-soft); }
html[data-theme] body #dashboard .dashboard-problem.tone-green b { color: var(--green); background: var(--green-soft); }
html[data-theme] body #dashboard .dashboard-problem.tone-blue b { color: var(--accent-text); background: var(--accent-soft); }

/* ---------- Регионы ---------- */
html[data-theme] body #dashboard .region-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}
html[data-theme] body #dashboard .region-row > div { flex: 1; min-width: 0; }
html[data-theme] body #dashboard .region-row span { font-size: 0.85rem; font-weight: 500; color: var(--text); }
html[data-theme] body #dashboard .region-row small { display: block; margin: 2px 0 6px; font-size: 0.73rem; color: var(--text-3); }
html[data-theme] body #dashboard .region-row .bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
html[data-theme] body #dashboard .region-row .bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  animation: growWidth 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}
html[data-theme] body #dashboard .region-row strong {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
html[data-theme] body #dashboard .region-spread h3 {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-3);
}

/* ---------- Последняя загрузка ---------- */
html[data-theme] body #dashboard .dashboard-import-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
html[data-theme] body #dashboard .dashboard-import-head strong { font-size: 1.05rem; font-weight: 700; }
html[data-theme] body #dashboard .dashboard-import-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 900px) {
  html[data-theme] body #dashboard .dashboard-import-grid { grid-template-columns: repeat(2, 1fr); }
}
html[data-theme] body #dashboard .dashboard-import-grid > div { display: grid; gap: 3px; padding: 10px 12px; }
html[data-theme] body #dashboard .dashboard-import-grid span { font-size: 0.72rem; }
html[data-theme] body #dashboard .dashboard-import-grid strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
html[data-theme] body #dashboard .dashboard-theme-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  font-size: 0.78rem;
}

/* ---------- Каскад появления панелей ---------- */
html[data-theme] body .tab.active .dash-row-main { animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.16s both; }
html[data-theme] body .tab.active .dash-row-secondary { animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.24s both; }

@media (prefers-reduced-motion: reduce) {
  html[data-theme] body #dashboard .ratio-bar b,
  html[data-theme] body #dashboard .bar-fill,
  html[data-theme] body #dashboard .dashboard-bar-track span,
  html[data-theme] body #dashboardUpdatedAt::before { animation: none; }
}

/* ============================================================
   КОНТУР 2.4 — ДАШБОРД: ЕДИНОЕ ПОЛОТНО БЕЗ ДЫР
   ============================================================ */

/* Правая колонка: две панели друг под другом, тянутся на высоту левой */
html[data-theme] body .dash-col {
  display: grid;
  gap: 12px;
  align-content: start;
}
html[data-theme] body .dash-row-main { align-items: stretch; }
html[data-theme] body .dash-regions { margin-bottom: 12px; }

/* Карточки качества: нейтральный фон, цвет — только в полоске и цифре */
html[data-theme] body #dashboard .dashboard-ratio-card,
html[data-theme] body #dashboard .dashboard-ratio-card.tone-green,
html[data-theme] body #dashboard .dashboard-ratio-card.tone-amber,
html[data-theme] body #dashboard .dashboard-ratio-card.tone-red,
html[data-theme] body #dashboard .dashboard-ratio-card.tone-blue,
html[data-theme] body #dashboard .dashboard-ratio-card.tone-purple {
  border: 1px solid var(--border);
  background: var(--surface);
}
html[data-theme] body #dashboard .dashboard-ratio-card.tone-green .ratio-value strong { color: var(--green); }
html[data-theme] body #dashboard .dashboard-ratio-card.tone-amber .ratio-value strong { color: var(--amber); }
html[data-theme] body #dashboard .dashboard-ratio-card.tone-red .ratio-value strong { color: var(--red); }
html[data-theme] body #dashboard .dashboard-ratio-card.tone-blue .ratio-value strong,
html[data-theme] body #dashboard .dashboard-ratio-card.tone-purple .ratio-value strong { color: var(--accent-text); }

html[data-theme] body #dashboard .dashboard-chart-head {
  display: grid;
  gap: 2px;
  margin-bottom: 12px;
}
html[data-theme] body #dashboard .dashboard-chart-head span { display: block; }

/* Проблемы данных: компактнее, чтобы колонка дышала в ритме левой */
html[data-theme] body #dashboard .dashboard-problem { padding: 9px 12px; }
html[data-theme] body #dashboard .facts { display: grid; gap: 8px; }

/* Регионы: две колонки на всю ширину, без дублирующего заголовка */
html[data-theme] body #dashboard .region-spread h3 { display: none; }
html[data-theme] body #dashboard .region-spread {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 32px;
}
@media (max-width: 900px) {
  html[data-theme] body #dashboard .region-spread { grid-template-columns: 1fr; }
}
html[data-theme] body #dashboard .region-row { padding: 7px 0; }
html[data-theme] body #dashboard .region-row strong { display: none; } /* число уже есть в подписи */
html[data-theme] body #dashboard .region-row small { margin-bottom: 5px; }

/* Последняя загрузка: сетка 2×2 в узкой колонке */
html[data-theme] body .dash-col .dashboard-import-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ============================================================
   КОНТУР 2.5 — ТИПОГРАФИЧЕСКАЯ ШКАЛА ДАШБОРДА
   Четыре уровня, как в эталоне. Ничего между ними.
   ─ Уровень 1 (герои):   KPI и сосуд ......... 1.35rem / 700
   ─ Уровень 2 (значения): карточки, импорт ... 1.15rem / 700
   ─ Уровень 3 (в графиках): счётчики баров ... 0.9rem / 700
   ─ Подписи: капс .70rem/600 · пояснения .75rem/400
   ============================================================ */

/* — Подписи-капсы: у ВСЕХ карточек одинаковые — */
html[data-theme] body #dashboard .dashboard-stat span,
html[data-theme] body #dashboard .stat span,
html[data-theme] body #dashboard .dashboard-ratio-card > span,
html[data-theme] body #dashboard .dashboard-import-grid span,
html[data-theme] body #dashboard .dashboard-split h3 {
  color: var(--text-3);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.35;
}

/* — Пояснения (не капс): одинаковые везде — */
html[data-theme] body #dashboard .dashboard-stat small,
html[data-theme] body #dashboard .stat small,
html[data-theme] body #dashboard .ratio-value small,
html[data-theme] body #dashboard .dashboard-problem span,
html[data-theme] body #dashboard .region-row small,
html[data-theme] body #dashboard .dashboard-import-head span,
html[data-theme] body #dashboard .dashboard-chart-head span,
html[data-theme] body #dashboard .quality-label span,
html[data-theme] body #dashboard .dashboard-bar-item small,
html[data-theme] body #dashboard .dashboard-theme-strip span,
html[data-theme] body #dashboard .panel-head p {
  color: var(--text-3);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.4;
}

/* — Уровень 1: KPI и сосуд — */
html[data-theme] body #dashboard .dashboard-stat strong,
html[data-theme] body #dashboard .stat strong {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
html[data-theme] body #dashboard .quality-label strong {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* — Уровень 2: значения в карточках качества и импорта — */
html[data-theme] body #dashboard .ratio-value strong,
html[data-theme] body #dashboard .dashboard-import-grid strong,
html[data-theme] body #dashboard .dashboard-import-head strong {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

/* — Уровень 3: счётчики внутри графиков — */
html[data-theme] body #dashboard .dashboard-bar-item strong,
html[data-theme] body #dashboard .dashboard-problem b,
html[data-theme] body #dashboard .dashboard-mini-bar b {
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* — Названия строк (проблемы, регионы, мини-бары): один размер — */
html[data-theme] body #dashboard .dashboard-problem strong,
html[data-theme] body #dashboard .region-row span,
html[data-theme] body #dashboard .dashboard-mini-bar > div:first-child span {
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.35;
}

/* — Заголовки панелей: единые — */
html[data-theme] body #dashboard .panel-head h2 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* — Выравнивание базовых линий в ratio-карточках — */
html[data-theme] body #dashboard .ratio-value { align-items: baseline; gap: 8px; }
html[data-theme] body #dashboard .ratio-value small { font-variant-numeric: tabular-nums; }

/* — Тематическая строка импорта: значения жирнее подписи — */
html[data-theme] body #dashboard .dashboard-theme-strip b {
  color: var(--text-2);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   КОНТУР 2.6 — ЧИСТЫЙ ВЕРХ СТРАНИЦЫ
   ============================================================ */

/* Топбар больше не «коробка»: только чип пользователя справа */
html[data-theme] body .topbar.topbar-slim {
  justify-content: flex-end;
  padding: 0;
  margin-bottom: 14px;
  border: none;
  border-radius: 0;
  background: transparent;
  min-height: 0;
}

/* Заголовок дашборда: крупнее, с фирменным градиентом */
html[data-theme] body #dashboard .dash-hero-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(100deg, var(--accent), #7b5bd6 85%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
html[data-theme] body #dashboard .dashboard-title { align-items: center; margin-bottom: 16px; }

/* «Обновлено» — внизу сайдбара, над переключателем темы */
html[data-theme] body .sidebar-updated {
  margin-top: auto;
  padding: 0 10px 6px;
  font-size: 0.72rem;
}
html[data-theme] body .sidebar .theme-toggle { margin-top: 0; }

/* ============================================================
   КОНТУР 2.7 — ШАПКА В ОДНУ ЛИНИЮ
   Чип пользователя встаёт на линию заголовка страницы —
   пустой «этаж» сверху исчезает совсем.
   ============================================================ */
html[data-theme] body .main { position: relative; }
html[data-theme] body .topbar.topbar-slim {
  position: absolute;
  top: 24px;
  right: 28px;
  margin: 0;
  padding: 0;
  z-index: 20;
}
/* Первой строке каждой вкладки резервируем место под чип справа */
html[data-theme] body .tab > .panel-title-row:first-child {
  min-height: 46px;
  align-items: center;
  padding-right: 250px;
}
html[data-theme] body .tab > .panel:first-child > .panel-head:first-child {
  min-height: 46px;
  padding-right: 270px;
}
html[data-theme] body .tab > .layout:first-child {
  padding-top: 58px;
}
@media (max-width: 900px) {
  html[data-theme] body .topbar.topbar-slim {
    position: static;
    justify-content: flex-end;
    margin-bottom: 10px;
  }
  html[data-theme] body .tab > .panel-title-row:first-child,
  html[data-theme] body .tab > .panel:first-child > .panel-head:first-child {
    padding-right: 0;
  }
  html[data-theme] body .tab > .layout:first-child {
    padding-top: 0;
  }
}

/* ============================================================
   DASHBOARD CHARTS — единая чистая отрисовка графиков
   ============================================================ */
html[data-theme] body #dashboard .dashboard-bars {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: 176px;
  align-items: end;
  gap: 18px;
  padding: 8px 10px 0;
  border-bottom: 0;
  margin-bottom: 0;
}
html[data-theme] body #dashboard .dashboard-bar-item {
  display: grid;
  grid-template-rows: 124px auto auto;
  justify-items: center;
  align-items: end;
  gap: 7px;
}
html[data-theme] body #dashboard .dashboard-bar-track {
  position: relative;
  width: 54px;
  max-width: 54px;
  height: 124px;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
html[data-theme] body #dashboard .dashboard-bar-track span {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 0;
  display: block;
  width: auto;
  height: var(--bar-pct, 8%);
  min-height: 6px;
  border-radius: 8px 8px 2px 2px;
  transform: none;
  animation: none;
  opacity: 1;
  box-shadow: 0 12px 24px rgba(20, 22, 40, 0.1);
}
html[data-theme] body #dashboard .dashboard-bar-item.today .dashboard-bar-track span {
  height: var(--bar-pct, 32%);
}
html[data-theme] body #dashboard .dashboard-bar-item.tomorrow .dashboard-bar-track span {
  height: var(--bar-pct, 8%);
}
html[data-theme] body #dashboard .dashboard-bar-item.soon .dashboard-bar-track span {
  height: var(--bar-pct, 25%);
}
html[data-theme] body #dashboard .dashboard-bar-item.later .dashboard-bar-track span {
  height: var(--bar-pct, 100%);
}
html[data-theme] body #dashboard .dashboard-bar-item.unknown .dashboard-bar-track span {
  height: var(--bar-pct, 8%);
}
html[data-theme] body #dashboard .dashboard-bar-item.today .dashboard-bar-track span {
  background: linear-gradient(180deg, #df4568 0%, #cf385b 100%);
}
html[data-theme] body #dashboard .dashboard-bar-item.tomorrow .dashboard-bar-track span,
html[data-theme] body #dashboard .dashboard-bar-item.soon .dashboard-bar-track span {
  background: linear-gradient(180deg, #c89213 0%, #b77c09 100%);
}
html[data-theme] body #dashboard .dashboard-bar-item.later .dashboard-bar-track span {
  background: linear-gradient(180deg, #6c63df 0%, #5550d7 100%);
}
html[data-theme] body #dashboard .dashboard-bar-item.unknown .dashboard-bar-track span {
  background: linear-gradient(180deg, #d6d9e4 0%, #c4c8d5 100%);
  box-shadow: none;
}
html[data-theme] body #dashboard .dashboard-bar-item strong {
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
html[data-theme] body #dashboard .dashboard-bar-item small {
  color: var(--text-3);
  font-size: 0.72rem;
}

/* Дубль аква-шара удалён: канонический блок ниже — «ВОССТАНОВЛЕНО ПОСЛЕ СЛИЯНИЯ ВЕТОК» */
/* ---------- Dashboard import cards: fixed compact layout ---------- */
html[data-theme] body #dashboard .dashboard-import {
  gap: 16px;
}

html[data-theme] body #dashboard .dashboard-import-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 8px;
  align-items: stretch;
}

html[data-theme] body .dash-col #dashboard .dashboard-import-grid,
html[data-theme] body #dashboard .dash-col .dashboard-import-grid {
  grid-template-columns: repeat(4, minmax(72px, 1fr));
}

html[data-theme] body #dashboard .dashboard-import-grid > div {
  display: grid;
  grid-template-rows: minmax(18px, auto) 1fr;
  align-content: space-between;
  min-width: 0;
  min-height: 84px;
  padding: 12px 12px 11px;
  border-radius: 12px;
}

html[data-theme] body #dashboard .dashboard-import-grid span {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--text-3);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.15;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

html[data-theme] body #dashboard .dashboard-import-grid strong {
  display: flex;
  align-items: flex-end;
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
}

html[data-theme] body #dashboard .dashboard-import-grid strong.dashboard-import-money {
  display: grid;
  align-content: end;
  justify-items: start;
  gap: 2px;
  min-width: 0;
  margin: 0;
  white-space: normal;
}

html[data-theme] body #dashboard .dashboard-import-grid strong.dashboard-import-money b {
  display: block;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

html[data-theme] body #dashboard .dashboard-import-grid strong.dashboard-import-money small {
  display: block;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

html[data-theme] body #dashboard .dashboard-import-grid strong.dashboard-import-money.single {
  display: block;
}

@media (max-width: 1180px) {
  html[data-theme] body #dashboard .dashboard-import-grid,
  html[data-theme] body #dashboard .dash-col .dashboard-import-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* ============================================================
   ВОССТАНОВЛЕНО ПОСЛЕ СЛИЯНИЯ ВЕТОК: аква-шар (вода + дополнения)
   ============================================================ */
html[data-theme] body #dashboard .quality-vessel {
  position: relative;
  width: 150px;
  height: 150px;
  overflow: hidden;
  border: 1px solid rgba(82, 139, 218, 0.34);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.62) 0 15%, rgba(255, 255, 255, 0) 45%),
    #f6f7fc;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    inset 0 2px 10px rgba(28, 32, 50, 0.08),
    0 18px 34px rgba(85, 80, 215, 0.14);
}
html[data-theme] body #dashboard .quality-vessel::after {
  content: "";
  position: absolute;
  inset: 8px 12px auto 18px;
  height: 62px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0) 68%);
  transform: rotate(-18deg);
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
}
html[data-theme] body #dashboard .quality-liquid {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  height: var(--fill, 91%);
  min-height: 0;
  transform: none;
  animation: dashboardWaterGlow 5.8s ease-in-out infinite;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 31%),
    radial-gradient(circle at 70% 62%, rgba(116, 222, 255, 0.25), rgba(116, 222, 255, 0) 34%),
    linear-gradient(180deg, rgba(166, 218, 255, 0.92) 0%, rgba(91, 157, 236, 0.96) 52%, rgba(78, 97, 213, 0.97) 100%);
  box-shadow:
    inset 0 24px 34px rgba(255, 255, 255, 0.24),
    inset 0 -22px 38px rgba(36, 70, 172, 0.26),
    0 -1px 0 rgba(111, 191, 255, 0.75);
  z-index: 0;
}
html[data-theme] body #dashboard .quality-liquid::before {
  content: "";
  position: absolute;
  left: -26%;
  right: -26%;
  top: -13px;
  height: 28px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 46%, rgba(255, 255, 255, 0.95), rgba(190, 229, 255, 0.6) 48%, rgba(255, 255, 255, 0) 74%),
    rgba(157, 215, 255, 0.62);
  filter: blur(0.25px);
  animation: dashboardWaterSurface 3.8s ease-in-out infinite;
  box-shadow:
    0 0 0 1px rgba(92, 170, 255, 0.38),
    0 7px 16px rgba(69, 126, 225, 0.28);
}
html[data-theme] body #dashboard .quality-liquid::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 18% 28%, rgba(255, 255, 255, 0.26) 0 9%, transparent 25%),
    radial-gradient(ellipse at 62% 26%, rgba(255, 255, 255, 0.2) 0 8%, transparent 23%),
    radial-gradient(ellipse at 78% 66%, rgba(173, 239, 255, 0.22) 0 10%, transparent 27%),
    radial-gradient(ellipse at 36% 74%, rgba(255, 255, 255, 0.12) 0 8%, transparent 24%);
  background-size: 150% 150%, 132% 132%, 158% 158%, 140% 140%;
  opacity: 0.62;
  mix-blend-mode: screen;
  animation: dashboardWaterCaustics 7.2s ease-in-out infinite;
  pointer-events: none;
}
html[data-theme] body #dashboard .quality-wave {
  position: absolute;
  top: -130px;
  left: 50%;
  display: block;
  width: 282px;
  height: 282px;
  margin-left: -141px;
  border-radius: 42% 58% 46% 54%;
  background:
    radial-gradient(circle at 45% 45%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.04) 58%),
    rgba(232, 230, 255, 0.58);
  animation: dashboardWaterWave 7.8s linear infinite;
  pointer-events: none;
  opacity: 0.96;
  mix-blend-mode: screen;
}
html[data-theme] body #dashboard .quality-wave.w2 {
  top: -120px;
  width: 312px;
  height: 312px;
  margin-left: -156px;
  border-radius: 58% 42% 56% 44%;
  background:
    radial-gradient(circle at 56% 45%, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.02) 62%),
    rgba(119, 112, 229, 0.32);
  animation-duration: 11.6s;
  animation-direction: reverse;
  opacity: 0.78;
}
html[data-theme] body #dashboard .quality-wave.w2::after {
  content: "";
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  filter: blur(8px);
}
html[data-theme] body #dashboard .quality-label {
  z-index: 6;
  isolation: isolate;
}
html[data-theme] body #dashboard .quality-label strong {
  color: #111827;
  font-size: 1.55rem;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.72),
    0 10px 24px rgba(79, 92, 160, 0.18);
}
html[data-theme] body #dashboard .quality-label span {
  color: rgba(30, 41, 59, 0.7);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
html[data-theme="dark"] body #dashboard .quality-label strong {
  color: #0f172a;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.78),
    0 0 18px rgba(255, 255, 255, 0.5);
}
html[data-theme="dark"] body #dashboard .quality-label span {
  color: rgba(15, 23, 42, 0.7);
}
html[data-theme] body #dashboard .quality-vessel-wrap .dashboard-donut-legend .legend-good {
  background: #58a9ff;
  box-shadow: 0 0 0 3px rgba(88, 169, 255, 0.16);
}

@keyframes dashboardWaterWave {
  0% { transform: translate3d(-8px, 0, 0) rotate(0deg) scale(1); }
  35% { transform: translate3d(7px, 4px, 0) rotate(126deg) scale(1.025); }
  70% { transform: translate3d(3px, -3px, 0) rotate(252deg) scale(0.985); }
  100% { transform: translate3d(-8px, 0, 0) rotate(360deg) scale(1); }
}
@keyframes dashboardWaterSurface {
  0%, 100% { transform: translateX(-7%) scaleX(1.08) rotate(-1deg); opacity: 0.78; }
  50% { transform: translateX(7%) scaleX(0.94) rotate(1deg); opacity: 1; }
}
@keyframes dashboardWaterCaustics {
  0%, 100% {
    background-position: 0% 15%, 80% 20%, 30% 90%, 16% 82%;
    transform: translate3d(-2px, 0, 0) rotate(0deg) scale(1);
  }
  50% {
    background-position: 55% 35%, 20% 65%, 72% 40%, 62% 18%;
    transform: translate3d(3px, -2px, 0) rotate(1deg) scale(1.025);
  }
}
@keyframes dashboardWaterGlow {
  0%, 100% { filter: saturate(1.02) brightness(1); }
  45% { filter: saturate(1.14) brightness(1.055); }
  70% { filter: saturate(1.05) brightness(0.99); }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme] body #dashboard .quality-liquid,
  html[data-theme] body #dashboard .quality-liquid::before,
  html[data-theme] body #dashboard .quality-liquid::after,
  html[data-theme] body #dashboard .quality-wave {
    animation: none;
  }
}


/* ============================================================
   АКВА-ШАР: дополнения к «воде» —
   подъём при загрузке + живые пузырьки (не меняя сам стиль воды)
   ============================================================ */
/* Вода поднимается снизу при появлении дашборда */
html[data-theme] body #dashboard .quality-liquid {
  animation:
    vesselRise 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both,
    dashboardWaterGlow 5.8s ease-in-out 2s infinite;
}

/* Пузырьки: всплывают со дна к поверхности */
html[data-theme] body #dashboard .quality-bubble {
  position: absolute;
  bottom: 4%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.4);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  animation: bubbleUp 4.4s ease-in infinite;
}

html[data-theme] body #dashboard .quality-bubble.b1 { left: 26%; animation-delay: 0.6s; }
html[data-theme] body #dashboard .quality-bubble.b2 { left: 48%; width: 4px; height: 4px; animation-delay: 1.9s; animation-duration: 3.8s; }
html[data-theme] body #dashboard .quality-bubble.b3 { left: 66%; width: 5px; height: 5px; animation-delay: 2.8s; }
html[data-theme] body #dashboard .quality-bubble.b4 { left: 38%; width: 3px; height: 3px; animation-delay: 3.4s; animation-duration: 5.2s; }

/* Свой отдельный блик не нужен — у воды уже есть блик на сфере */
html[data-theme] body #dashboard .quality-glare {
  display: none;
}

/* Каркас до загрузки данных: вода и пузырьки замирают, стиль тот же */
html[data-theme] body #dashboard .dash-loading .quality-liquid,
html[data-theme] body #dashboard .dash-loading .quality-liquid::before,
html[data-theme] body #dashboard .dash-loading .quality-liquid::after,
html[data-theme] body #dashboard .dash-loading .quality-wave,
html[data-theme] body #dashboard .dash-loading .quality-bubble,
html[data-theme] body #dashboard .quality-vessel.is-loading .quality-liquid,
html[data-theme] body #dashboard .quality-vessel.is-loading .quality-wave,
html[data-theme] body #dashboard .quality-vessel.is-loading .quality-bubble {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme] body #dashboard .quality-liquid,
  html[data-theme] body #dashboard .quality-bubble {
    animation: none !important;
  }
}

/* ============================================================
   АКВА-ШАР v3 — видимая кромка воды, мягкое качание,
   приглушённая тёмная тема
   ============================================================ */

/* Кромка воды: светлая «линза» на поверхности, мягко качается */
html[data-theme] body #dashboard .quality-liquid::before {
  content: "";
  position: absolute;
  left: -14%;
  right: -14%;
  top: -9px;
  height: 18px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(255, 255, 255, 0.95), rgba(196, 228, 255, 0.6) 52%, rgba(255, 255, 255, 0) 76%);
  box-shadow:
    0 3px 9px rgba(69, 118, 220, 0.32),
    0 -1px 0 rgba(255, 255, 255, 0.65);
  filter: none;
  animation: surfaceRock 4.6s ease-in-out infinite;
}

@keyframes surfaceRock {
  0%, 100% { transform: translateX(-4.5%) rotate(-1.6deg); }
  50% { transform: translateX(4.5%) rotate(1.6deg); }
}

/* Волны: две широкие плоские «линзы» у кромки, качаются в противофазе */
html[data-theme] body #dashboard .quality-wave {
  top: -14px;
  left: -38%;
  width: 176%;
  height: 26px;
  margin-left: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  mix-blend-mode: normal;
  opacity: 1;
  animation: waveDrift 5.2s ease-in-out infinite;
}

html[data-theme] body #dashboard .quality-wave.w2 {
  top: -8px;
  left: -30%;
  width: 164%;
  height: 22px;
  margin-left: 0;
  border-radius: 50%;
  background: rgba(126, 176, 255, 0.30);
  animation: waveDrift 7.6s ease-in-out infinite reverse;
}

html[data-theme] body #dashboard .quality-wave.w2::after {
  display: none;
}

@keyframes waveDrift {
  0%, 100% { transform: translateX(-6%) rotate(-2.2deg); }
  50% { transform: translateX(6%) rotate(2.2deg); }
}

/* ---------- Тёмная тема: сфера и вода глубже, без белого сияния ---------- */
html[data-theme="dark"] body #dashboard .quality-vessel {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border-strong));
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.08) 0 15%, rgba(255, 255, 255, 0) 46%),
    var(--surface-2);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 2px 12px rgba(0, 0, 0, 0.5),
    0 16px 36px color-mix(in srgb, var(--accent) 18%, transparent);
}

html[data-theme="dark"] body #dashboard .quality-vessel::after {
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 68%);
  mix-blend-mode: normal;
}

html[data-theme="dark"] body #dashboard .quality-liquid {
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 32%),
    linear-gradient(180deg, rgba(96, 128, 226, 0.52) 0%, rgba(72, 90, 202, 0.72) 52%, rgba(50, 60, 156, 0.85) 100%);
  box-shadow:
    inset 0 18px 26px rgba(255, 255, 255, 0.05),
    inset 0 -20px 34px rgba(8, 14, 56, 0.5),
    0 -1px 0 rgba(140, 170, 255, 0.4);
}

html[data-theme="dark"] body #dashboard .quality-liquid::before {
  background:
    radial-gradient(ellipse at 50% 48%, rgba(214, 230, 255, 0.55), rgba(150, 184, 255, 0.32) 52%, rgba(255, 255, 255, 0) 76%);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.35),
    0 -1px 0 rgba(200, 220, 255, 0.28);
}

html[data-theme="dark"] body #dashboard .quality-liquid::after {
  opacity: 0.28;
}

html[data-theme="dark"] body #dashboard .quality-wave {
  background: rgba(190, 212, 255, 0.16);
}

html[data-theme="dark"] body #dashboard .quality-wave.w2 {
  background: rgba(140, 168, 255, 0.14);
}

html[data-theme="dark"] body #dashboard .quality-bubble {
  background: rgba(214, 230, 255, 0.45);
  box-shadow: 0 0 5px rgba(160, 190, 255, 0.3);
}

/* Подпись в тёмной теме — светлая, вода тёмная */
html[data-theme="dark"] body #dashboard .quality-label strong {
  color: var(--text);
  text-shadow: 0 1px 10px rgba(8, 10, 30, 0.65);
}

html[data-theme="dark"] body #dashboard .quality-label span {
  color: var(--text-2);
  text-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme] body #dashboard .quality-liquid::before,
  html[data-theme] body #dashboard .quality-wave {
    animation: none !important;
  }
}

/* ============================================================
   ПАКЕТ УЛУЧШЕНИЙ: фон-вкладка, тач-таргеты, мелочи
   ============================================================ */
/* Вкладка в фоне — останавливаем бесконечные анимации воды */
html.page-hidden body #dashboard .quality-liquid,
html.page-hidden body #dashboard .quality-liquid::before,
html.page-hidden body #dashboard .quality-liquid::after,
html.page-hidden body #dashboard .quality-wave,
html.page-hidden body #dashboard .quality-bubble {
  animation-play-state: paused;
}

/* Подсказка «Ctrl K» не нужна на узких/сенсорных экранах */
@media (max-width: 720px) {
  html[data-theme] body .search kbd,
  html[data-theme] body .topbar kbd {
    display: none;
  }
}

/* Тач-таргеты на телефоне: кнопки достаточно крупные для пальца */
@media (max-width: 560px) {
  html[data-theme] body .bk-actions button,
  html[data-theme] body .button,
  html[data-theme] body .segment-switch button,
  html[data-theme] body .nav-item {
    min-height: 44px;
  }
}

/* ============================================================
   АДАПТИВ, ПОЛНАЯ СПЕЦИФИЧНОСТЬ.
   Поздние широкоэкранные слои (html[data-theme] body …) перебивали
   старые медиазапросы — дублируем мобильные правила на их уровне.
   ============================================================ */
@media (max-width: 1100px) {
  html[data-theme] body .shell {
    grid-template-columns: 1fr;
  }

  html[data-theme] body .sidebar {
    position: static;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  html[data-theme] body .nav {
    overflow: visible;
  }

  html[data-theme] body .layout.two,
  html[data-theme] body .dashboard-import-grid {
    grid-template-columns: 1fr;
  }

  /* Планшет: статистика в две колонки, на телефоне (ниже) — в одну */
  html[data-theme] body .stats,
  html[data-theme] body .bk-summary,
  html[data-theme] body #dashboard .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme] body #dashboard .dashboard-layout,
  html[data-theme] body #dashboard .dashboard-visual-grid,
  html[data-theme] body #dashboard .dashboard-overview-grid,
  html[data-theme] body #dashboard .dashboard-split {
    grid-template-columns: 1fr;
  }

  html[data-theme] body .bk-table-row,
  html[data-theme] body .bk-lead-row {
    grid-template-columns: 1fr;
  }

  html[data-theme] body .bk-table-head {
    display: none;
  }

  html[data-theme] body .bk-actions {
    justify-content: flex-start;
  }

  html[data-theme] body .main {
    max-width: none;
  }
}

@media (max-width: 900px) {
  html[data-theme] body #dashboard .dashboard-overview-grid,
  html[data-theme] body #dashboard .dashboard-import-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  html[data-theme] body .main,
  html[data-theme] body .sidebar {
    padding: 16px;
  }

  html[data-theme] body .topbar,
  html[data-theme] body .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  html[data-theme] body .toolbar input[type="search"],
  html[data-theme] body .toolbar input,
  html[data-theme] body .toolbar select {
    width: 100%;
    /* В колонке flex-basis (240px) стал бы высотой — возвращаем авто. */
    flex: 0 0 auto;
  }
}

@media (max-width: 560px) {
  html[data-theme] body .stats,
  html[data-theme] body .bk-summary,
  html[data-theme] body #dashboard .stats {
    grid-template-columns: 1fr;
  }

  html[data-theme] body .segment-switch {
    width: 100%;
  }

  html[data-theme] body .bk-actions {
    flex-wrap: wrap;
  }

  html[data-theme] body .bk-score {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }
}

}

/* Новые правила пишем сюда — простые селекторы, слой app побеждает legacy. */
@layer app {
  .empty-action {
    margin-top: 14px;
  }
}

/* ============================================================
   БУРГЕР-МЕНЮ НА ТЕЛЕФОНЕ/ПЛАНШЕТЕ (@layer app — без префиксов)
   Чекбокс-переключатель: работает под строгим CSP без JS.
   ============================================================ */
@layer app {
  .burger { display: none; }
  .nav-backdrop { display: none; }

  @media (max-width: 1100px) {
    /* Бургер в топбаре слева, пользователь справа */
    .burger {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      margin-right: auto;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--surface);
      color: var(--text-2);
      cursor: pointer;
    }
    .burger svg { width: 20px; height: 20px; }
    .burger:active { transform: scale(0.94); }

    /* Сайдбар — выезжающая панель, по умолчанию скрыта за левым краем */
    .sidebar {
      position: fixed;
      top: 0;
      left: 0;
      bottom: 0;
      width: 270px;
      max-width: 82vw;
      transform: translateX(-100%);
      transition: transform 0.25s ease;
      z-index: 50;
      overflow-y: auto;
      box-shadow: 0 0 40px rgba(0, 0, 0, 0.35);
    }
    .nav-toggle:checked ~ .sidebar { transform: none; }

    /* Затемнение фона + закрытие по клику вне меню (label — снимает чекбокс) */
    .nav-toggle:checked ~ .nav-backdrop {
      display: block;
      position: fixed;
      inset: 0;
      z-index: 40;
      background: rgba(0, 0, 0, 0.45);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .sidebar { transition: none; }
  }
}

@layer app {
  .two-factor-panel { margin-top: 16px; }
  .twofa-status {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 99px;
    white-space: nowrap;
  }
  .twofa-status.on { background: var(--green-soft); color: var(--green); }
  .twofa-status.off { background: var(--surface-2); color: var(--text-3); }
  .twofa-status.pending { background: var(--amber-soft); color: var(--amber); }
  .twofa-hint { color: var(--text-2); font-size: 0.88rem; margin: 8px 0; }
  .twofa-hint a { color: var(--accent-text); }
  .twofa-secret {
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 12px 14px;
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    user-select: all;
    word-break: break-all;
  }
  .twofa-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
  }
  .twofa-row input {
    width: 140px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    letter-spacing: 0.15em;
  }
  .twofa-error { color: var(--red); font-size: 0.85rem; margin-top: 8px; min-height: 1em; }
  .button.danger { background: var(--red-soft); color: var(--red); border-color: transparent; }
}

/* ============================================================
   ВИЗУАЛЬНЫЕ УЛУЧШЕНИЯ (@layer app — простые селекторы, без борьбы
   со специфичностью). Контраст, живой логотип, переход темы, тени.
   ============================================================ */
@layer app {
  /* 1. Контраст: серые подписи в СВЕТЛОЙ теме были 2.89:1 (норма ≥4.5). */
  html[data-theme="light"] {
    --text-3: #6b7180; /* ~4.6:1 на белом — WCAG AA для мелкого текста */
    --shadow-sm: 0 1px 3px rgba(20, 22, 40, 0.08);
    --shadow-md: 0 8px 24px rgba(20, 22, 40, 0.10);
  }

  /* 2. Живой логотип: медленное вращение контуров + пульс центра.
        Держим деликатно — это «дыхание», не спиннер загрузки. */
  @keyframes logoSpin { to { transform: rotate(360deg); } }
  @keyframes logoSpinRev { to { transform: rotate(-360deg); } }
  @keyframes logoPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.32); opacity: 0.72; }
  }
  .brand .logo-mark path:first-of-type,
  .auth-logo .logo-mark path:first-of-type {
    transform-origin: 24px 24px;
    animation: logoSpin 26s linear infinite;
  }
  .brand .logo-mark path:last-of-type,
  .auth-logo .logo-mark path:last-of-type {
    transform-origin: 24px 24px;
    animation: logoSpinRev 34s linear infinite;
  }
  .brand .logo-mark circle:last-of-type,
  .auth-logo .logo-mark circle:last-of-type {
    transform-origin: 24px 24px;
    animation: logoPulse 3.2s ease-in-out infinite;
  }
  /* лёгкое ускорение вращения при наведении — «оживает» под курсором */
  .brand:hover .logo-mark path:first-of-type { animation-duration: 8s; }
  .brand:hover .logo-mark path:last-of-type { animation-duration: 11s; }

  /* 3. Плавный переход между темами на крупных поверхностях. */
  html[data-theme] body,
  html[data-theme] .sidebar,
  html[data-theme] .main,
  html[data-theme] .panel,
  html[data-theme] .stat,
  html[data-theme] .topbar {
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.2s ease;
  }

  @media (prefers-reduced-motion: reduce) {
    .brand .logo-mark path,
    .auth-logo .logo-mark path,
    .brand .logo-mark circle:last-of-type,
    .auth-logo .logo-mark circle:last-of-type {
      animation: none;
    }
  }
}

@layer app {
  /* Тёмная тема: legacy-блоки карточек/модалок с жёсткими светлыми фонами */
  html[data-theme=dark] body .similar-leads,
  html[data-theme=dark] body .tender-item,
  html[data-theme=dark] body .platform-row,
  html[data-theme=dark] body .tender-money-summary div {
    background: var(--surface-2);
  }

  html[data-theme=dark] body .tender-item.selected,
  html[data-theme=dark] body .tender-focus-note {
    background: var(--accent-soft);
    color: var(--text-2);
  }

  html[data-theme=dark] body .similar-tenders {
    color: var(--text-2);
  }

  html[data-theme=dark] body .tender-pill.active,
  html[data-theme=dark] body .tender-status.active {
    color: var(--green);
    background: var(--green-soft);
  }

  html[data-theme=dark] body .tender-pill.closed,
  html[data-theme=dark] body .tender-status.closed {
    color: var(--amber);
    background: var(--amber-soft);
  }

  html[data-theme=dark] body .tender-status.focused,
  html[data-theme=dark] body .tender-pill.law,
  html[data-theme=dark] body .tender-law {
    color: #9ec3f8;
    background: #16243c;
  }
}

@layer app {
  @keyframes bk-notice-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: none; }
  }
}

@layer app {
  /* Статус отправки в Битрикс: своя строка под кнопками, адаптивно */
  html[data-theme] body .bk-actions .bk-action-notice {
    flex-basis: 100%;
    margin: 2px 0 0;
    padding: 8px 10px;
    font-size: 12.5px;
    text-align: left;
    overflow-wrap: anywhere;
  }
}

@layer app {
  html[data-theme] body .bk-docs-more {
    color: var(--text-3);
    font-size: 12.5px;
    white-space: nowrap;
  }
}

@layer app {
  /* Файлы тендера в карточке лида */
  html[data-theme] body .tender-doc-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 7px;
    font-size: 12.5px;
  }
  html[data-theme] body .tender-doc-links a {
    color: var(--accent-text);
    text-decoration: none;
  }
  html[data-theme] body .tender-doc-links a:hover {
    text-decoration: underline;
  }
}

@layer app {
  /* «+ ещё N» раскрывает скрытые документы */
  html[data-theme] body .doc-extra {
    display: none;
  }
  html[data-theme] body .docs-expanded .doc-extra {
    display: inline;
  }
  html[data-theme] body .bk-docs-more {
    border: 0;
    padding: 0;
    background: none;
    color: var(--accent-text);
    font: inherit;
    font-size: 12.5px;
    cursor: pointer;
    white-space: nowrap;
  }
  html[data-theme] body .bk-docs-more:hover {
    text-decoration: underline;
  }
}

@layer app {
  /* Открыта модалка — работаем только в ней: фон не прокручивается,
     а скролл внутри карточки не перетекает наружу на границах списков. */
  html[data-theme]:has(dialog[open]),
  html[data-theme] body:has(dialog[open]) {
    overflow: hidden;
  }
  html[data-theme] body:has(dialog[open]) .main {
    overflow: hidden;
  }
  html[data-theme] body dialog,
  html[data-theme] body dialog .tender-history-list,
  html[data-theme] body dialog .platform-list {
    overscroll-behavior: contain;
  }
}

@layer app {
  html[data-theme] body .job-already-sent {
    color: var(--text-3);
    font-size: 12.5px;
    white-space: nowrap;
  }
}

@layer app {
  html[data-theme] body .boot-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 60vh;
    text-align: center;
    padding: 24px;
  }
  html[data-theme] body .boot-error h2 {
    margin: 0;
  }
  html[data-theme] body .boot-error p {
    margin: 0;
    color: var(--text-2);
  }
  html[data-theme] body .boot-error button {
    margin-top: 8px;
  }
}


/* ═══════════════════════════════════════════════════════════
   Переключатель оформления «Контур / Аврора» + тема «Аврора».
   «Контур» (по умолчанию) не затрагивается: Аврора — слой поверх токенов.
   ═══════════════════════════════════════════════════════════ */
.sidebar-updated { margin-top: auto; }
.theme-toggle { margin-top: 0; }

.design-switch {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  padding: 4px;
  margin-top: 8px;
  border: 1px solid var(--sidebar-line);
  border-radius: 12px;
  background: var(--surface-2);
}
.design-switch-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
}
html[data-design="aurora"] .design-switch-thumb { transform: translateX(100%); }
.design-opt {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 8px 6px;
  font: 600 12.5px/1 var(--font);
  color: var(--sidebar-muted);
  transition: color 0.2s;
}
.design-opt[aria-pressed="true"] { color: var(--text); }
.design-opt:hover { color: var(--text); }
@media (prefers-reduced-motion: reduce) {
  .design-switch-thumb { transition: none; }
}

/* — Аврора: мягкий шалфейно-мятный воздух, крупные скругления,
     жёлтый акцент с ТЁМНЫМ текстом (высокий контраст). — */
html[data-design="aurora"] {
  --bg: #dde7e0;
  --surface: #f5f8f4;
  --surface-2: #eaefe8;
  --surface-hover: #eef3ec;
  --border: #d6ddd6;
  --border-strong: #c4cdc4;
  --sidebar-bg: #eef3ec;
  --accent: #cdd400;
  --accent-hover: #d8df1e;
  --accent-soft: #eef3c6;
  --accent-text: #5f6d0e;
  --mark-color: #33380a;
  --panel-radius: 22px;
  --control-radius: 14px;
  --shadow-sm: 0 1px 2px rgba(40, 50, 30, 0.05);
  --shadow-md: 0 6px 24px rgba(40, 50, 30, 0.08);
  --shadow-lg: 0 18px 50px rgba(40, 50, 30, 0.13), 0 2px 8px rgba(40, 50, 30, 0.05);
}
html[data-design="aurora"] body {
  background:
    radial-gradient(1100px 620px at 22% 2%, rgba(226, 236, 150, 0.30), transparent 58%),
    radial-gradient(1300px 760px at 90% 6%, rgba(190, 214, 204, 0.42), transparent 60%),
    var(--bg);
}
html[data-design="aurora"][data-theme="dark"] {
  --bg: #141a16;
  --surface: #1a211c;
  --surface-2: #202821;
  --surface-hover: #1e2620;
  --border: #2b352d;
  --border-strong: #3a463c;
  --sidebar-bg: #161d18;
  --accent: #d3dc2e;
  --accent-hover: #dde647;
  --accent-soft: #2a3312;
  --accent-text: #cdd93f;
  --mark-color: #242a06;
}
html[data-design="aurora"][data-theme="dark"] body {
  background:
    radial-gradient(1100px 620px at 22% 2%, rgba(120, 140, 40, 0.14), transparent 58%),
    radial-gradient(1300px 760px at 90% 6%, rgba(80, 120, 105, 0.18), transparent 60%),
    var(--bg);
}
/* Тёмный текст на жёлтом акценте — иначе белое на жёлтом нечитаемо */
html[data-design="aurora"] body .button.primary,
html[data-design="aurora"] body .button.primary:hover,
html[data-design="aurora"] .auth-submit,
html[data-design="aurora"] .auth-submit:hover,
html[data-design="aurora"] body .nav-item.active .nav-count,
html[data-design="aurora"] body .segment-switch button.active .segment-count,
html[data-design="aurora"] mark,
html[data-design="aurora"] .mark {
  color: var(--mark-color);
}


/* ═══ Aurora bold: компонентный слой (стекло, воздух, скругления) ═══ */
html[data-design="aurora"] body {
  background:
    radial-gradient(1200px 700px at 20% -2%, rgba(224,236,150,.5), transparent 55%),
    radial-gradient(1300px 760px at 92% 4%, rgba(176,214,201,.7), transparent 58%),
    radial-gradient(900px 800px at 60% 60%, rgba(206,228,214,.55), transparent 60%),
    linear-gradient(165deg, #e7efe4, #dde8e0 55%, #e4ece5);
}
html[data-design="aurora"] body .sidebar { background: rgba(247,250,245,.9); border-radius: 0 28px 28px 0; }
html[data-design="aurora"] body .topbar { background: rgba(247,250,245,.85); border-radius: 22px; }
html[data-design="aurora"] body .panel {
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 24px;
  box-shadow: 0 10px 34px rgba(60,80,50,.10);
  padding: 26px;
}
html[data-design="aurora"] body .stat.dashboard-stat { border-radius: 22px; padding: 20px 22px; }
html[data-design="aurora"] body .dashboard-grid { gap: 18px; }
html[data-design="aurora"] body .stats { gap: 16px; }
html[data-design="aurora"] body .button { border-radius: 999px; }
html[data-design="aurora"] body .status-pill,
html[data-design="aurora"] body .key-pill,
html[data-design="aurora"] body .advance-pill,
html[data-design="aurora"] body .nav-item { border-radius: 999px; }
html[data-design="aurora"] body .bk-table-row { border-radius: 18px; }

/* Тёмная Аврора: тёмное стекло вместо белого */
html[data-design="aurora"][data-theme="dark"] body {
  background:
    radial-gradient(1200px 700px at 20% -2%, rgba(120,140,40,.16), transparent 55%),
    radial-gradient(1300px 760px at 92% 4%, rgba(70,110,95,.20), transparent 58%),
    linear-gradient(165deg, #12160f, #141a16 55%, #12160f);
}
html[data-design="aurora"][data-theme="dark"] body .sidebar { background: rgba(22,29,24,.88); }
html[data-design="aurora"][data-theme="dark"] body .topbar { background: rgba(22,29,24,.82); }
html[data-design="aurora"][data-theme="dark"] body .panel {
  background: rgba(28,36,30,.72);
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
