@charset "UTF-8";

/* Дефолтные стили для UI компонентов библиотеки msweb-ui */
html.theme-fade * {
  transition: background-color 500ms ease, color 500ms ease, border-color 500ms ease, fill 500ms ease, stroke 500ms ease !important;
}

.theme-switcher {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1200;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: rgba(255, 255, 255, 0.95);
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(4px);
  overflow: hidden;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.theme-switcher--inline {
  position: relative;
  top: auto;
  right: auto;
  box-shadow: none;
  backdrop-filter: none;
}

.theme-switcher:hover {
  transform: translateY(-1px);
  border-color: #93c5fd;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.20);
}

.theme-switcher:active {
  transform: translateY(0);
}

.theme-switcher svg {
  width: 22px;
  height: 22px;
  display: block;
}

.theme-switcher__icon-wrap {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-switcher.theme-switcher--auto-large .theme-switcher__icon-wrap {
  width: 31px;
  height: 31px;
}

.theme-switcher.theme-switcher--auto-large svg {
  width: 31px;
  height: 31px;
  top: 3px;
  position: relative;
}

.theme-switcher__icon {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.theme-switcher__icon--current {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.theme-switcher__icon--in-rise,
.theme-switcher__icon--in-set {
  animation: theme-arc-in .5s linear both;
}

.theme-switcher__icon--out-rise,
.theme-switcher__icon--out-set {
  animation: theme-arc-out .5s linear both;
}

@keyframes theme-arc-in {
  0% {
    opacity: 0;
    transform: translate(-20px, 20.0px) scale(0.68);
  }

  20% {
    opacity: 0.55;
    transform: translate(-16px, 12.8px) scale(0.80);
  }

  40% {
    opacity: 0.85;
    transform: translate(-12px, 7.2px) scale(0.90);
  }

  60% {
    opacity: 1;
    transform: translate(-8px, 3.2px) scale(0.97);
  }

  80% {
    opacity: 1;
    transform: translate(-4px, 0.8px) scale(1.00);
  }

  100% {
    opacity: 1;
    transform: translate(0px, 0.0px) scale(1.00);
  }
}

@keyframes theme-arc-out {
  0% {
    opacity: 1;
    transform: translate(0px, 0.0px) scale(1.00);
  }

  20% {
    opacity: 0.90;
    transform: translate(4px, 0.8px) scale(1.00);
  }

  40% {
    opacity: 0.70;
    transform: translate(8px, 3.2px) scale(0.90);
  }

  60% {
    opacity: 0.40;
    transform: translate(12px, 7.2px) scale(0.80);
  }

  80% {
    opacity: 0.15;
    transform: translate(16px, 12.8px) scale(0.72);
  }

  100% {
    opacity: 0;
    transform: translate(20px, 20.0px) scale(0.62);
  }
}

[data-theme="dark"] .theme-switcher {
  background: rgba(15, 23, 42, 0.94);
  color: #dbe5f3;
  border-color: #334155;
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.45);
}

[data-theme="dark"] .theme-switcher::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 21% 19%, #e2e8f0 1.1px, transparent 1.6px),
    radial-gradient(circle at 73% 15%, #cbd5e1 0.8px, transparent 1.2px),
    radial-gradient(circle at 85% 54%, #e2e8f0 0.9px, transparent 1.3px),
    radial-gradient(circle at 77% 81%, #94a3b8 0.7px, transparent 1.1px),
    radial-gradient(circle at 24% 82%, #e2e8f0 1.0px, transparent 1.4px),
    radial-gradient(circle at 13% 53%, #cbd5e1 0.7px, transparent 1.1px),
    radial-gradient(circle at 50% 10%, #94a3b8 0.6px, transparent 1.0px);
  opacity: 0.75;
}

/* --- Toast / Notice (неблокирующие уведомления) --- */
.msweb-toast-container {
  position: fixed;
  z-index: 10100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.msweb-toast-container--top-right {
  top: 16px;
  right: 16px;
}

.msweb-toast-container--top-left {
  top: 16px;
  left: 16px;
}

.msweb-toast-container--bottom-right {
  bottom: 16px;
  right: 16px;
}

.msweb-toast-container--bottom-left {
  bottom: 16px;
  left: 16px;
}

.msweb-toast {
  min-width: 260px;
  max-width: 440px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 12px;
  padding: 11px 12px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
  transform: translateY(-8px);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: auto;
}

.msweb-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.msweb-toast.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
}

.msweb-toast__message {
  flex: 1;
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}

.msweb-toast__close {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 2px;
}

.msweb-toast__close:hover {
  color: #0f172a;
}

.msweb-toast--info {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.msweb-toast--success {
  border-color: #86efac;
  background: #ecfdf5;
}

.msweb-toast--warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.msweb-toast--error {
  border-color: #fca5a5;
  background: #fef2f2;
}

.theme-dark .msweb-toast,
[data-theme="dark"] .msweb-toast {
  border-color: #334155;
  background: #0f172a;
  color: #e2e8f0;
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.45);
}

.theme-dark .msweb-toast__close,
[data-theme="dark"] .msweb-toast__close {
  color: #94a3b8;
}

.theme-dark .msweb-toast__close:hover,
[data-theme="dark"] .msweb-toast__close:hover {
  color: #e2e8f0;
}

.theme-dark .msweb-toast--info,
[data-theme="dark"] .msweb-toast--info {
  border-color: #1d4ed8;
  background: #0b1a3a;
}

.theme-dark .msweb-toast--success,
[data-theme="dark"] .msweb-toast--success {
  border-color: #166534;
  background: #052e1c;
}

.theme-dark .msweb-toast--warning,
[data-theme="dark"] .msweb-toast--warning {
  border-color: #a16207;
  background: #3a2502;
}

.theme-dark .msweb-toast--error,
[data-theme="dark"] .msweb-toast--error {
  border-color: #991b1b;
  background: #3f0d0d;
}

/* --- Переменные --- */
/* Checkbox / Radio размеры */
/* Список типов инпутов для генерации селекторов */
/* Миксин: вариант кнопки (primary/secondary/save/cancel/delete) */
/* Все правила сконструированы так: либо внутри .msweb-ui, либо .msweb-ui { &.class } */
.msweb-ui {
  /* box-sizing для полей и кнопок (UA-стили переопределяют по тегу) */
}

.msweb-ui input,
.msweb-ui textarea,
.msweb-ui select,
.msweb-ui button {
  box-sizing: border-box;
}

.msweb-ui.ui-component {
  position: relative;
}

.msweb-ui-loader-active > :not(.msweb-ui-loader-overlay) {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

.msweb-ui-loader-overlay {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(1px);
}

.msweb-ui-loader-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(79, 110, 247, 0.25);
  border-top-color: #4f6ef7;
  border-radius: 50%;
  animation: msweb-ui-loader-spin 0.8s linear infinite;
}

@keyframes msweb-ui-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

.theme-dark .msweb-ui-loader-overlay,
[data-theme="dark"] .msweb-ui-loader-overlay {
  background: rgba(15, 23, 42, 0.5);
}

.theme-dark .msweb-ui-loader-spinner,
[data-theme="dark"] .msweb-ui-loader-spinner {
  border-color: rgba(148, 163, 184, 0.28);
  border-top-color: #93c5fd;
}

.msweb-ui {
  /* --- Кнопки (Button): элемент сам имеет классы .msweb-ui.btn --- */
}

.msweb-ui.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 8px 20px;
  margin: 0;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: #fff;
  color: #1e293b;
  outline: none;
  box-sizing: border-box;
}

.msweb-ui.btn:hover {
  background-color: #f1f5f9;
  border-color: #9ca3af;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.msweb-ui.btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.msweb-ui.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.3);
  border-color: #4f6ef7;
}

.msweb-ui.btn:disabled,
.msweb-ui.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.msweb-ui.btn.primary {
  background-color: #4f6ef7;
  color: #fff;
  border-color: #4f6ef7;
  box-shadow: 0 1px 3px rgba(79, 110, 247, 0.3);
}

.msweb-ui.btn.primary:hover {
  background-color: #3b5ae0;
  border-color: #3b5ae0;
  box-shadow: 0 4px 12px rgba(79, 110, 247, 0.35);
}

.msweb-ui.btn.danger {
  background-color: #ef4444;
  color: #fff;
  border-color: #ef4444;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3);
}

.msweb-ui.btn.danger:hover {
  background-color: #dc2626;
  border-color: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.msweb-ui.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.msweb-ui.btn-icon-only {
  padding: 0;
  min-width: 34px;
}

.msweb-ui.btn-icon-only svg {
  flex-shrink: 0;
}

.msweb-ui.btn-icon svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: block;
}

.msweb-ui.btn-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.msweb-ui.btn-group .btn-group-item-hidden {
  display: none !important;
}

.msweb-ui.btn-group-hidden {
  display: none !important;
}

.msweb-ui {
  /* --- Аккордеон (Accordion) --- */
}

.msweb-ui.accordion {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.msweb-ui.accordion .accordion-item {
  border-bottom: 1px solid #e5e7eb;
}

.msweb-ui.accordion .accordion-item:last-child {
  border-bottom: none;
}

.msweb-ui.accordion .accordion-item.active>.accordion-header {
  background: #fff;
}

.msweb-ui.accordion .accordion-item.active>.accordion-header .accordion-icon {
  transform: rotate(180deg);
}

.msweb-ui.accordion .accordion-item.active>.accordion-content {
  background: #fff;
}

.msweb-ui.accordion .accordion-item.active>.accordion-content>div {
  padding: 20px 24px;
}

.msweb-ui.accordion .accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  cursor: pointer;
  background: #f8fafc;
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.msweb-ui.accordion .accordion-header:hover {
  background: #e5e7eb;
}

.msweb-ui.accordion .accordion-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}

.msweb-ui.accordion .accordion-icon {
  font-size: 0.75em;
  color: #64748b;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.msweb-ui.accordion .accordion-content {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.msweb-ui.accordion .accordion-item.active>.accordion-content {
  grid-template-rows: 1fr;
}

.msweb-ui.accordion .accordion-content>div {
  display: flow-root;
  min-height: 0;
  overflow: hidden;
  padding: 0 24px;
  transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.msweb-ui.accordion.page-feature-accordion .accordion-item--headerless:not(.active) {
  border-bottom: none;
}

.msweb-ui.accordion.page-feature-accordion.accordion--has-collapsed-headerless-item {
  background: transparent;
  border: none;
  box-shadow: none;
  margin-bottom: 0;
}

.msweb-ui.accordion.page-feature-accordion .accordion-item--headerless:not(.active) > .accordion-content > div {
  padding: 0;
}

.msweb-ui {
  /* --- Вкладки (Tabs) --- */
}

.msweb-ui.tabs-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.msweb-ui.tabs-container .tabs-header-wrap {
  display: flex;
  align-items: stretch;
}

.msweb-ui.tabs-container .tabs-header-wrap .tabs-header {
  flex: 1;
  min-width: 0;
}

.msweb-ui.tabs-container .tabs-scroll-btns {
  display: none;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
  background: #f8fafc;
  border-bottom: 2px solid #e5e7eb;
  flex-shrink: 0;
}

.msweb-ui.tabs-container .tabs-scroll-btns--visible {
  display: flex;
}

.msweb-ui.tabs-container .tabs-scroll-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: #64748b;
  padding: 0;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}

.msweb-ui.tabs-container .tabs-scroll-btn:hover:not(:disabled) {
  background: #f1f5f9;
  color: #1e293b;
}

.msweb-ui.tabs-container .tabs-scroll-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.msweb-ui.tabs-container .tabs-header {
  display: flex;
  border-bottom: 2px solid #e5e7eb;
  gap: 4px;
  background: #f8fafc;
  padding: 0 8px;
  overflow-x: auto;
  overflow-y: hidden;
}

.msweb-ui.tabs-container .tabs-header::-webkit-scrollbar {
  width: 2px;
  height: 2px;
}

.msweb-ui.tabs-container .tabs-header::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

.msweb-ui.tabs-container .tabs-header::-webkit-scrollbar-track {
  background: transparent;
}

@supports (-moz-appearance: none) {
  .msweb-ui.tabs-container .tabs-header {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
  }
}

.msweb-ui.tabs-container .tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 6px 6px 0 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.msweb-ui.tabs-container .tab-btn-label {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msweb-ui.tabs-container .tab-btn-close {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: #94a3b8;
  opacity: 0;
  transition: all 0.15s ease;
}

.msweb-ui.tabs-container .tab-btn:hover {
  color: #4f6ef7;
  background-color: rgba(79, 110, 247, 0.12);
}

.msweb-ui.tabs-container .tab-btn:hover .tab-btn-close,
.msweb-ui.tabs-container .tab-btn.active .tab-btn-close {
  opacity: 1;
}

.msweb-ui.tabs-container .tab-btn-close:hover {
  color: #334155;
  background: rgba(15, 23, 42, 0.08);
}

.msweb-ui.tabs-container .tab-btn.active {
  color: #4f6ef7;
  border-bottom-color: #4f6ef7;
  font-weight: 600;
  background-color: #fff;
}

.msweb-ui.tabs-container>.tab-content {
  display: none;
  padding: 20px 24px;
  overflow: auto;
  min-height: 0;
}

.msweb-ui.tabs-container>.tab-content.active {
  display: block;
}

.msweb-ui .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.msweb-ui {
  /* --- Форма: поля и лейблы --- */
}

.msweb-ui .form-field {
  margin-bottom: 18px;
}

.msweb-ui .form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 12px;
  color: #64748b;
  letter-spacing: 0.01em;
}

.msweb-ui .form-label-inline {
  margin: 0;
  font-weight: 600;
  font-size: 14px;
  color: #1e293b;
  white-space: nowrap;
  text-align: left;
}

.msweb-ui .form-label-inline.form-label-tight {
  min-width: 0;
}

.msweb-ui .validation-error {
  color: #ef4444;
  font-size: 0.85em;
  margin-top: 6px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.msweb-ui {
  /* --- Варианты кнопок (элемент: .msweb-ui.btn.btn-primary и т.д.) --- */
}

.msweb-ui.btn-primary {
  background-color: #4f6ef7;
  color: #fff;
  border: 1px solid transparent;
  padding: 10px 22px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.msweb-ui.btn-primary:hover {
  background-color: #3b5ae0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.msweb-ui.btn-primary:active {
  transform: translateY(1px);
}

.msweb-ui.btn-primary {
  box-shadow: 0 1px 3px rgba(79, 110, 247, 0.3);
}

.msweb-ui.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(79, 110, 247, 0.35);
}

.msweb-ui.btn-secondary {
  background-color: #e8eeff;
  color: #4f6ef7;
  border: 1px solid transparent;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 0px;
  margin-right: 0px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.msweb-ui.btn-secondary:hover {
  background-color: #d4e0ff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.msweb-ui.btn-secondary:active {
  transform: translateY(1px);
}

.msweb-ui.btn-save {
  background-color: #4f6ef7;
  color: #fff;
  border: 1px solid transparent;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  margin-right: 5px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.msweb-ui.btn-save:hover {
  background-color: #3b5ae0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.msweb-ui.btn-save:active {
  transform: translateY(1px);
}

.msweb-ui.btn-cancel {
  background-color: #e8eeff;
  color: #1e293b;
  border: 1px solid transparent;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.msweb-ui.btn-cancel:hover {
  background-color: #d4e0ff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.msweb-ui.btn-cancel:active {
  transform: translateY(1px);
}

.msweb-ui.btn-delete {
  background-color: #ef4444;
  color: #fff;
  border: 1px solid transparent;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  margin-right: 5px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.msweb-ui.btn-delete:hover {
  background-color: #dc2626;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.msweb-ui.btn-delete:active {
  transform: translateY(1px);
}

.msweb-ui.btn-modal-delete {
  background-color: #ef4444;
  color: #fff;
  border-radius: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.msweb-ui.btn-modal-delete:hover {
  background-color: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.msweb-ui.btn-modal-cancel {
  background-color: #e8eeff;
  color: #4f6ef7;
  border: 1px solid transparent;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.msweb-ui.btn-modal-cancel:hover {
  background-color: #d4e0ff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.msweb-ui.btn-modal-cancel:active {
  transform: translateY(1px);
}

.msweb-ui {
  /* --- Textarea: сообщение об ошибке и состояние .input-error --- */
}

.msweb-ui .textarea-error-message {
  margin-top: 6px;
  color: #ef4444;
  font-size: 12px;
  display: none;
  padding: 8px 12px;
  background: #fef2f2;
  border-radius: 6px;
  border-left: 3px solid #ef4444;
}

.msweb-ui .input-error,
.msweb-ui input.input-error,
.msweb-ui textarea.input-error,
.msweb-ui select.input-error {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.msweb-ui {
  /* --- Grid компонент (handle — тот же элемент с классами msweb-ui + grid-resize-handle) --- */
}

.msweb-ui.grid-resize-handle {
  position: absolute;
  z-index: 1000;
  transition: all 0.15s ease;
  background: transparent;
}

.msweb-ui.grid-resize-handle.resizing {
  transition: none;
}

.msweb-ui.grid-resize-handle.resizing::before {
  background: #4f6ef7;
}

.msweb-ui.grid-resize-handle-vertical {
  width: 6px;
  cursor: col-resize;
  margin-left: -2px;
}

.msweb-ui.grid-resize-handle-vertical::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(50% - 27px);
  bottom: 0;
  width: 2px;
  background: #9ac1fb;
  transform: translateX(-50%);
  transition: background 0.15s ease;
  height: 50px;
}

.msweb-ui.grid-resize-handle-vertical:hover::before,
.msweb-ui.grid-resize-handle-vertical.resizing::before {
  background: #4f6ef7;
}

.msweb-ui.grid-resize-handle-horizontal {
  height: 6px;
  cursor: row-resize;
  margin-top: -2px;
}

.msweb-ui.grid-resize-handle-horizontal::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(50% - 27px);
  right: 0;
  height: 2px;
  background: #9ac1fb;
  transform: translateY(-50%);
  transition: background 0.15s ease;
  width: 50px;
}

.msweb-ui.grid-resize-handle-horizontal:hover::before,
.msweb-ui.grid-resize-handle-horizontal.resizing::before {
  background: #4f6ef7;
}

.msweb-ui {
  /* --- Tooltip: корневой элемент имеет классы .msweb-ui.tooltip --- */
}

.msweb-ui.tooltip {
  position: fixed;
  background: #1e293b;
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  max-width: 300px;
  z-index: 2147483647;
  display: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(4px);
}

.msweb-ui .tooltip-content {
  word-wrap: break-word;
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
  cursor: text;
}

.msweb-ui .tooltip-arrow {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #1e293b;
}

.msweb-ui .tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #4f6ef7;
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 4px;
  vertical-align: middle;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.msweb-ui .tooltip-icon:hover {
  background-color: #3b5ae0;
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.12);
}

.msweb-ui {
  /* --- Поля ввода (Input, Select, Textarea): общие стили через сгенерированный селектор --- */
}

.msweb-ui input[type=text],
.msweb-ui input[type=tel],
.msweb-ui input[type=number],
.msweb-ui input[type=email],
.msweb-ui input[type=password],
.msweb-ui select,
.msweb-ui textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: #1e293b;
  background-color: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.msweb-ui input[type=text]::-moz-placeholder,
.msweb-ui input[type=tel]::-moz-placeholder,
.msweb-ui input[type=number]::-moz-placeholder,
.msweb-ui input[type=email]::-moz-placeholder,
.msweb-ui input[type=password]::-moz-placeholder,
.msweb-ui select::-moz-placeholder,
.msweb-ui textarea::-moz-placeholder {
  color: #9ca3af;
}

.msweb-ui input[type=text]::placeholder,
.msweb-ui input[type=tel]::placeholder,
.msweb-ui input[type=number]::placeholder,
.msweb-ui input[type=email]::placeholder,
.msweb-ui input[type=password]::placeholder,
.msweb-ui select::placeholder,
.msweb-ui textarea::placeholder {
  color: #9ca3af;
}

.msweb-ui input[type=text]:hover:not(:disabled):not(:focus),
.msweb-ui input[type=tel]:hover:not(:disabled):not(:focus),
.msweb-ui input[type=number]:hover:not(:disabled):not(:focus),
.msweb-ui input[type=email]:hover:not(:disabled):not(:focus),
.msweb-ui input[type=password]:hover:not(:disabled):not(:focus),
.msweb-ui select:hover:not(:disabled):not(:focus),
.msweb-ui textarea:hover:not(:disabled):not(:focus) {
  border-color: #9ca3af;
}

.msweb-ui input[type=text]:focus,
.msweb-ui input[type=tel]:focus,
.msweb-ui input[type=number]:focus,
.msweb-ui input[type=email]:focus,
.msweb-ui input[type=password]:focus,
.msweb-ui select:focus,
.msweb-ui textarea:focus {
  outline: none;
  border-color: #4f6ef7;
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.3);
}

.msweb-ui input[type=text]:disabled,
.msweb-ui input[type=tel]:disabled,
.msweb-ui input[type=number]:disabled,
.msweb-ui input[type=email]:disabled,
.msweb-ui input[type=password]:disabled,
.msweb-ui select:disabled,
.msweb-ui textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background-color: #f1f5f9;
}

.msweb-ui textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── InputDiv (contenteditable div, без автозаполнения браузера) ──────── */
.msweb-ui .input-div {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: #1e293b;
  background-color: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  min-height: 38px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
  cursor: text;
}

.msweb-ui .input-div[data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}

.msweb-ui .input-div:hover:not([aria-disabled="true"]):not(:focus) {
  border-color: #9ca3af;
}

.msweb-ui .input-div:focus {
  outline: none;
  border-color: #4f6ef7;
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.3);
}

.msweb-ui.input-wrapper--invalid input,
.msweb-ui.input-wrapper--invalid .input-div {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18) !important;
}

.msweb-ui .input-div[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  background-color: #f1f5f9;
}

.theme-dark .msweb-ui .input-div,
[data-theme="dark"] .msweb-ui .input-div {
  border-color: #374151;
  background-color: #1f2937;
  color: #f3f4f6;
}

.theme-dark .msweb-ui .input-div:hover:not([aria-disabled="true"]):not(:focus),
[data-theme="dark"] .msweb-ui .input-div:hover:not([aria-disabled="true"]):not(:focus) {
  border-color: #6b7280;
}

.msweb-ui {
  /* --- Кастомный чекбокс (CSS-only) --- */
}

.msweb-ui input[type=checkbox] {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  -moz-appearance: none;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  background-color: #fff;
  transition: all 0.15s ease;
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.msweb-ui input[type=checkbox]::after {
  content: "";
  display: block;
  width: 6px;
  height: 12px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: -4px;
}

.msweb-ui input[type=checkbox]:hover:not(:disabled) {
  border-color: #4f6ef7;
}

.msweb-ui input[type=checkbox]:checked {
  background-color: #4f6ef7;
  border-color: #4f6ef7;
}

.msweb-ui input[type=checkbox]:checked::after {
  transform: rotate(45deg) scale(1);
}

.msweb-ui input[type=checkbox]:focus-visible {
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.3);
}

.msweb-ui input[type=checkbox]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.msweb-ui label:has(input[type=checkbox]) {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 0;
}

.msweb-ui label:has(input[type=checkbox]) input[type=checkbox] {
  flex-shrink: 0;
  margin-right: 0;
}

.msweb-ui {
  /* --- Обёртки полей --- */
}

.msweb-ui .input-wrapper {
  position: relative;
  width: 100%;
}

/* ── Input actions (copy, visibility toggle, etc.) ────── */
.msweb-ui .input-actions {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 1;
}

.msweb-ui .input-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  background: none;
  color: #9ca3af;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s, background-color 0.15s;
  flex-shrink: 0;
}

.msweb-ui .input-action-btn:hover {
  color: #374151;
  background-color: #f3f4f6;
}

.msweb-ui .input-action-btn--copied {
  color: #16a34a;
}

.theme-dark .msweb-ui .input-action-btn,
[data-theme="dark"] .msweb-ui .input-action-btn {
  color: #6b7280;
}

.theme-dark .msweb-ui .input-action-btn:hover,
[data-theme="dark"] .msweb-ui .input-action-btn:hover {
  color: #d1d5db;
  background-color: #374151;
}

.theme-dark .msweb-ui .input-action-btn--copied,
[data-theme="dark"] .msweb-ui .input-action-btn--copied {
  color: #4ade80;
}

.msweb-ui.select-component-wrapper {
  position: relative;
  width: 100%;
}

.msweb-ui.select-component-wrapper .select-component {
  margin-bottom: 10px;
}

.msweb-ui.textarea-component {
  position: relative;
  width: 100%;
  margin-bottom: 10px;
}

.msweb-ui.textarea-component textarea {
  width: 100%;
  box-sizing: border-box;
}

.msweb-ui.textarea-component textarea.textarea-json-mode {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  background-color: #f8fafc;
  line-height: 1.6;
}

.msweb-ui {
  /* --- Кастомные радио-кнопки (CSS-only) --- */
}

.msweb-ui .radio-group-component {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msweb-ui .radio-group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12px;
  color: #64748b;
}

.msweb-ui .radio-options-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.msweb-ui .radio-options-container.has-label {
  margin-left: 20px;
}

.msweb-ui .radio-option-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 0;
}

.msweb-ui .radio-option-wrapper input[type=radio] {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  -moz-appearance: none;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  background-color: #fff;
  transition: all 0.15s ease;
  position: relative;
  flex-shrink: 0;
}

.msweb-ui .radio-option-wrapper input[type=radio]::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.msweb-ui .radio-option-wrapper input[type=radio]:hover:not(:disabled) {
  border-color: #4f6ef7;
}

.msweb-ui .radio-option-wrapper input[type=radio]:checked {
  background-color: #4f6ef7;
  border-color: #4f6ef7;
}

.msweb-ui .radio-option-wrapper input[type=radio]:checked::after {
  transform: translate(-50%, -50%) scale(1);
}

.msweb-ui .radio-option-wrapper input[type=radio]:focus-visible {
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.3);
}

.msweb-ui .radio-option-wrapper input[type=radio]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.msweb-ui .radio-option-wrapper span {
  margin: 0;
  color: #1e293b;
  font-size: 14px;
}

.msweb-ui .radio-hint-icon {
  cursor: help;
  font-size: 0.8em;
  color: #64748b;
}

.msweb-ui {
  /* --- Overlay для отключенных полей --- */
}

.msweb-ui .input-disabled-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  z-index: 10;
  display: none;
  pointer-events: auto;
  border-radius: 6px;
}

.msweb-ui {
  /* --- Select2 --- */
}

.msweb-ui .select-component-wrapper .select2-container,
.msweb-ui .select2-container {
  width: 100% !important;
  margin-bottom: 10px;
}

.msweb-ui .select-component-wrapper .select2-container--default .select2-selection--single,
.msweb-ui .select2-container--default .select2-selection--single {
  position: relative;
  height: 38px;
  min-height: 38px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
}

.msweb-ui .select-component-wrapper .select2-container--default .select2-selection--single .select2-selection__rendered,
.msweb-ui .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 38px;
  padding-left: 12px;
  padding-right: 12px;
  color: #1e293b;
  display: flex;
  align-items: center;
  flex: 1;
}

.msweb-ui .select2-container--default .select2-selection--single .select2-selection__arrow {
  position: absolute;
  top: 0;
  right: 8px;
  width: 20px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.msweb-ui .select2-container--default .select2-selection--single .select2-selection__clear {
  float: none;
  /* не даём select2 прижать кнопку к правому краю поверх стрелки */
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 38px;
  margin-right: 28px;
  /* место под стрелку (20px) + отступ 8px */
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.msweb-ui .select2-container--default .select2-selection--single:hover {
  border-color: #9ca3af;
}

.msweb-ui .select2-container--default .select2-selection--single:focus {
  border-color: #4f6ef7;
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.3);
}

.msweb-ui .select-component-wrapper .select2-container--default .select2-selection--multiple,
.msweb-ui .select2-container--default .select2-selection--multiple {
  min-height: 38px;
  max-height: 76px;
  padding: 4px 28px 4px 4px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  overflow-y: auto;
  overflow-x: hidden;
}

.msweb-ui .select-component-wrapper .select2-container--default .select2-selection--multiple .select2-selection__rendered,
.msweb-ui .select2-container--default .select2-selection--multiple .select2-selection__rendered {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  gap: 4px;
  padding: 0;
}

.msweb-ui .select-component-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice,
.msweb-ui .select2-container--default .select2-selection--multiple .select2-selection__choice {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  margin: 0;
  padding-left: 18px;
  border-radius: 999px;
  vertical-align: middle;
}

.msweb-ui .select-component-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice__display,
.msweb-ui .select2-container--default .select2-selection--multiple .select2-selection__choice__display {
  padding: 2px 8px 2px 4px;
  line-height: 1.2;
}

.msweb-ui .select-component-wrapper .select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
.msweb-ui .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 5px;
}

.msweb-ui .select-component-wrapper .select2-container--default .select2-selection--multiple .select2-search--inline,
.msweb-ui .select2-container--default .select2-selection--multiple .select2-search--inline {
  display: inline-flex;
  align-items: center;
  flex: 1 1 120px;
  min-width: 120px;
  margin: 0;
}

.msweb-ui .select-component-wrapper .select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field,
.msweb-ui .select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
  min-height: 24px;
  height: 24px;
  margin: 0;
  padding: 0 4px;
  line-height: 24px;
}

.msweb-ui .select-component-wrapper .select2-container--default .select2-selection--multiple .select2-selection__clear,
.msweb-ui .select2-container--default .select2-selection--multiple .select2-selection__clear {
  top: 8px;
  right: 6px;
  margin: 0;
}

.msweb-ui {
  /* --- Модальные окна (Modal, Alert, Confirm): элементы сами имеют .msweb-ui.modal-backdrop и т.д. --- */
}

.msweb-ui.modal-backdrop {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 10000;
  animation: msweb-ui-fade-in 0.2s ease;
}

.msweb-ui.modal-small {
  background: #fff;
  padding: 0;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 20px rgba(0, 0, 0, 0.08);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: msweb-ui-slide-up 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.msweb-ui.modal-small h3 {
  margin: 0;
  padding: 20px 24px 16px;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}

.msweb-ui.modal-small .buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.msweb-ui.modal-small .buttons .btn-group,
.msweb-ui.modal-small .buttons .btn {
  flex: 0 0 auto;
  width: auto;
}

.msweb-ui.modal-small .buttons .btn {
  min-width: 120px;
  padding: 10px 16px;
  height: 40px;
}

.msweb-ui.modal-small>.buttons {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  margin-top: 0;
  background: #f8fafc;
  border-radius: 0 0 14px 14px;
}

.msweb-ui.modal-small.alert-dialog {
  padding: 0;
  max-width: 500px;
}

.msweb-ui.modal-wide {
  background: #fff;
  padding: 0;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 20px rgba(0, 0, 0, 0.08);
  width: min(1100px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: msweb-ui-slide-up 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.msweb-ui.modal-wide h3 {
  margin: 0;
  padding: 20px 24px 16px;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}

.msweb-ui.modal-wide .buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.msweb-ui.modal-wide .buttons .btn-group,
.msweb-ui.modal-wide .buttons .btn {
  flex: 0 0 auto;
  width: auto;
}

.msweb-ui.modal-wide .buttons .btn {
  min-width: 120px;
  padding: 10px 16px;
  height: 40px;
}

.msweb-ui.modal-wide>.buttons {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  margin-top: 0;
  background: #f8fafc;
  border-radius: 0 0 14px 14px;
}

.msweb-ui.modal-full {
  background: #fff;
  padding: 0;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 20px rgba(0, 0, 0, 0.08);
  width: calc(100vw - 48px);
  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .msweb-ui.modal-full {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);
  }
}

.msweb-ui.modal-full h3 {
  margin: 0;
  padding: 20px 24px 16px;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}

.msweb-ui.modal-full .buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.msweb-ui.modal-full .buttons .btn-group,
.msweb-ui.modal-full .buttons .btn {
  flex: 0 0 auto;
  width: auto;
}

.msweb-ui.modal-full .buttons .btn {
  min-width: 120px;
  padding: 10px 16px;
  height: 40px;
}

.msweb-ui.modal-full>.buttons {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  margin-top: 0;
  background: #f8fafc;
}

.msweb-ui.modal-body {
  margin-bottom: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 24px 20px;
  background: #fff;
}

.msweb-ui.modal-no-padding > .msweb-ui.modal-body {
  padding: 0;
}

.msweb-ui.modal-body .buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.msweb-ui.alert-title {
  margin: 0;
  padding: 20px 24px 12px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.msweb-ui.alert-message {
  padding: 20px 24px;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #64748b;
  line-height: 1.6;
}

.msweb-ui.checkbox-wrapper {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  padding: 4px 0;
}

.msweb-ui.checkbox-wrapper input[type=checkbox] {
  flex-shrink: 0;
  cursor: pointer;
  margin-right: 10px;
}

.msweb-ui.checkbox-wrapper>span {
  line-height: 1;
}

.msweb-ui.checkbox-wrapper:has(input[type=checkbox]:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}

.msweb-ui .input-container {
  position: relative;
  display: inline-block;
  width: 100%;
}

.msweb-ui .input-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.msweb-ui .udm-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #4f6ef7;
  color: #fff;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: bold;
  z-index: 1;
  box-shadow: 0 1px 3px rgba(79, 110, 247, 0.3);
}

/* --- Анимации для модальных окон --- */
@keyframes msweb-ui-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes msweb-ui-slide-up {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* DataTables dark theme — .theme-dark context */
.theme-dark .msweb-ui .dt-container table.dataTable thead th,
.theme-dark .msweb-ui .dt-container table.dataTable thead td {
  background-color: #0f172a;
  color: #f1f5f9;
  border-color: #334155;
}

.theme-dark .msweb-ui .dt-container table.dataTable tbody td,
.theme-dark .msweb-ui .dt-container table.dataTable tbody th,
.theme-dark .msweb-ui .dt-container table.dataTable tfoot td,
.theme-dark .msweb-ui .dt-container table.dataTable tfoot th {
  color: #cbd5e1;
  border-color: #334155;
}

.theme-dark .msweb-ui.ui-component div.dt-container .dt-length,
.theme-dark .msweb-ui.ui-component div.dt-container .dt-search,
.theme-dark .msweb-ui.ui-component div.dt-container .dt-info,
.theme-dark .msweb-ui.ui-component div.dt-container .dt-processing,
.theme-dark .msweb-ui.ui-component div.dt-container .dt-paging { color: #cbd5e1; }

.theme-dark .msweb-ui.ui-component div.dt-container .dt-paging .dt-paging-button {
  color: #94a3b8 !important;
  background: #0f172a;
  border-color: #334155;
}

.theme-dark .msweb-ui.ui-component div.dt-container .dt-paging .dt-paging-button.current,
.theme-dark .msweb-ui.ui-component div.dt-container .dt-paging .dt-paging-button.current:hover {
  color: #93c5fd !important;
  background: #172a46;
  border-color: #3b82f6;
}

.theme-dark .msweb-ui.modal-backdrop,
[data-theme="dark"] .msweb-ui.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.6);
}

.theme-dark .msweb-ui.modal-small,
[data-theme="dark"] .msweb-ui.modal-small {
  background: #2a2a3c;
  color: #e2e8f0;
  border: 1px solid #3f3f5c;
}

.theme-dark .msweb-ui.modal-small h3,
[data-theme="dark"] .msweb-ui.modal-small h3 {
  color: #e2e8f0;
}

.theme-dark .msweb-ui.modal-small > .msweb-ui.modal-body,
[data-theme="dark"] .msweb-ui.modal-small > .msweb-ui.modal-body,
.theme-dark .msweb-ui.modal-wide > .msweb-ui.modal-body,
[data-theme="dark"] .msweb-ui.modal-wide > .msweb-ui.modal-body {
  background: #2a2a3c;
  color: #e2e8f0;
}

.theme-dark .msweb-ui.modal-small>.buttons,
[data-theme="dark"] .msweb-ui.modal-small>.buttons {
  background: #1e1e2e;
  border-color: #3f3f5c;
}

.theme-dark .msweb-ui.alert-title,
[data-theme="dark"] .msweb-ui.alert-title {
  border-color: #3f3f5c;
}

.theme-dark .msweb-ui.alert-message,
[data-theme="dark"] .msweb-ui.alert-message {
  color: #94a3b8;
}

.theme-dark .msweb-ui.btn,
[data-theme="dark"] .msweb-ui.btn {
  background-color: #2a2a3c;
  color: #e2e8f0;
  border-color: #3f3f5c;
}

.theme-dark .msweb-ui.btn:hover,
[data-theme="dark"] .msweb-ui.btn:hover {
  background-color: #2e2e42;
  border-color: #64748b;
}

.theme-dark .msweb-ui.btn, [data-theme="dark"] .msweb-ui.btn.primary {
    background-color: #3851c1;
}

.theme-dark .msweb-ui .textarea-error-message,
[data-theme="dark"] .msweb-ui .textarea-error-message {
  color: #f87171;
  background: #451a1a;
  border: 1px solid #7f1d1d;
  border-left-width: 3px;
}

.theme-dark .msweb-ui .input-error,
.theme-dark .msweb-ui textarea.input-error,
.theme-dark .msweb-ui input.input-error,
[data-theme="dark"] .msweb-ui .input-error,
[data-theme="dark"] .msweb-ui textarea.input-error,
[data-theme="dark"] .msweb-ui input.input-error {
  border-color: #f87171 !important;
  background-color: #451a1a !important;
  color: #fff !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15) !important;
}

.theme-dark .msweb-ui input[type=text],
.theme-dark .msweb-ui input[type=number],
.theme-dark .msweb-ui input[type=email],
.theme-dark .msweb-ui input[type=password],
.theme-dark .msweb-ui select,
.theme-dark .msweb-ui textarea,
[data-theme="dark"] .msweb-ui input[type=text],
[data-theme="dark"] .msweb-ui input[type=number],
[data-theme="dark"] .msweb-ui input[type=email],
[data-theme="dark"] .msweb-ui input[type=password],
[data-theme="dark"] .msweb-ui select,
[data-theme="dark"] .msweb-ui textarea {
  background-color: #252536;
  border-color: #3f3f5c;
  color: #e2e8f0;
}

.theme-dark .msweb-ui input[type=text]::-moz-placeholder,
.theme-dark .msweb-ui input[type=tel]::-moz-placeholder,
.theme-dark .msweb-ui input[type=number]::-moz-placeholder,
.theme-dark .msweb-ui input[type=email]::-moz-placeholder,
.theme-dark .msweb-ui input[type=password]::-moz-placeholder,
.theme-dark .msweb-ui select::-moz-placeholder,
.theme-dark .msweb-ui textarea::-moz-placeholder,
[data-theme="dark"] .msweb-ui input[type=text]::-moz-placeholder,
[data-theme="dark"] .msweb-ui input[type=tel]::-moz-placeholder,
[data-theme="dark"] .msweb-ui input[type=number]::-moz-placeholder,
[data-theme="dark"] .msweb-ui input[type=email]::-moz-placeholder,
[data-theme="dark"] .msweb-ui input[type=password]::-moz-placeholder,
[data-theme="dark"] .msweb-ui select::-moz-placeholder,
[data-theme="dark"] .msweb-ui textarea::-moz-placeholder {
  color: #6b7280;
}

.theme-dark .msweb-ui input[type=text]::placeholder,
.theme-dark .msweb-ui input[type=tel]::placeholder,
.theme-dark .msweb-ui input[type=number]::placeholder,
.theme-dark .msweb-ui input[type=email]::placeholder,
.theme-dark .msweb-ui input[type=password]::placeholder,
.theme-dark .msweb-ui select::placeholder,
.theme-dark .msweb-ui textarea::placeholder,
[data-theme="dark"] .msweb-ui input[type=text]::placeholder,
[data-theme="dark"] .msweb-ui input[type=tel]::placeholder,
[data-theme="dark"] .msweb-ui input[type=number]::placeholder,
[data-theme="dark"] .msweb-ui input[type=email]::placeholder,
[data-theme="dark"] .msweb-ui input[type=password]::placeholder,
[data-theme="dark"] .msweb-ui select::placeholder,
[data-theme="dark"] .msweb-ui textarea::placeholder {
  color: #6b7280;
}

.theme-dark .msweb-ui input[type=text]:hover:not(:disabled):not(:focus),
.theme-dark .msweb-ui input[type=tel]:hover:not(:disabled):not(:focus),
.theme-dark .msweb-ui input[type=number]:hover:not(:disabled):not(:focus),
.theme-dark .msweb-ui input[type=email]:hover:not(:disabled):not(:focus),
.theme-dark .msweb-ui input[type=password]:hover:not(:disabled):not(:focus),
.theme-dark .msweb-ui select:hover:not(:disabled):not(:focus),
.theme-dark .msweb-ui textarea:hover:not(:disabled):not(:focus),
[data-theme="dark"] .msweb-ui input[type=text]:hover:not(:disabled):not(:focus),
[data-theme="dark"] .msweb-ui input[type=tel]:hover:not(:disabled):not(:focus),
[data-theme="dark"] .msweb-ui input[type=number]:hover:not(:disabled):not(:focus),
[data-theme="dark"] .msweb-ui input[type=email]:hover:not(:disabled):not(:focus),
[data-theme="dark"] .msweb-ui input[type=password]:hover:not(:disabled):not(:focus),
[data-theme="dark"] .msweb-ui select:hover:not(:disabled):not(:focus),
[data-theme="dark"] .msweb-ui textarea:hover:not(:disabled):not(:focus) {
  border-color: #64748b;
}

.theme-dark .msweb-ui input[type=text]:focus,
.theme-dark .msweb-ui input[type=tel]:focus,
.theme-dark .msweb-ui input[type=number]:focus,
.theme-dark .msweb-ui input[type=email]:focus,
.theme-dark .msweb-ui input[type=password]:focus,
.theme-dark .msweb-ui select:focus,
.theme-dark .msweb-ui textarea:focus,
[data-theme="dark"] .msweb-ui input[type=text]:focus,
[data-theme="dark"] .msweb-ui input[type=tel]:focus,
[data-theme="dark"] .msweb-ui input[type=number]:focus,
[data-theme="dark"] .msweb-ui input[type=email]:focus,
[data-theme="dark"] .msweb-ui input[type=password]:focus,
[data-theme="dark"] .msweb-ui select:focus,
[data-theme="dark"] .msweb-ui textarea:focus {
  border-color: #4f6ef7;
  background-color: #2e2e42;
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.2);
}

.theme-dark .msweb-ui input[type=text]:disabled,
.theme-dark .msweb-ui input[type=tel]:disabled,
.theme-dark .msweb-ui input[type=number]:disabled,
.theme-dark .msweb-ui input[type=email]:disabled,
.theme-dark .msweb-ui input[type=password]:disabled,
.theme-dark .msweb-ui select:disabled,
.theme-dark .msweb-ui textarea:disabled,
[data-theme="dark"] .msweb-ui input[type=text]:disabled,
[data-theme="dark"] .msweb-ui input[type=tel]:disabled,
[data-theme="dark"] .msweb-ui input[type=number]:disabled,
[data-theme="dark"] .msweb-ui input[type=email]:disabled,
[data-theme="dark"] .msweb-ui input[type=password]:disabled,
[data-theme="dark"] .msweb-ui select:disabled,
[data-theme="dark"] .msweb-ui textarea:disabled {
  background-color: #1a1a28;
  color: #6b7280;
}

.theme-dark .msweb-ui input[type=checkbox],
[data-theme="dark"] .msweb-ui input[type=checkbox] {
  background-color: #252536;
  border-color: #3f3f5c;
}

.theme-dark .msweb-ui input[type=checkbox]:hover:not(:disabled),
[data-theme="dark"] .msweb-ui input[type=checkbox]:hover:not(:disabled) {
  border-color: #4f6ef7;
}

.theme-dark .msweb-ui input[type=checkbox]:checked,
[data-theme="dark"] .msweb-ui input[type=checkbox]:checked {
  background-color: #4f6ef7;
  border-color: #4f6ef7;
}

.theme-dark .msweb-ui .radio-option-wrapper input[type=radio],
[data-theme="dark"] .msweb-ui .radio-option-wrapper input[type=radio] {
  background-color: #252536;
  border-color: #3f3f5c;
}

.theme-dark .msweb-ui .radio-option-wrapper input[type=radio]:hover:not(:disabled),
[data-theme="dark"] .msweb-ui .radio-option-wrapper input[type=radio]:hover:not(:disabled) {
  border-color: #4f6ef7;
}

.theme-dark .msweb-ui .radio-option-wrapper input[type=radio]:checked,
[data-theme="dark"] .msweb-ui .radio-option-wrapper input[type=radio]:checked {
  background-color: #4f6ef7;
  border-color: #4f6ef7;
}

.theme-dark .msweb-ui.accordion,
[data-theme="dark"] .msweb-ui.accordion {
  background: #2a2a3c;
  border-color: #3f3f5c;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.theme-dark .msweb-ui.accordion .accordion-header,
[data-theme="dark"] .msweb-ui.accordion .accordion-header {
  background: #1e1e2e;
}

.theme-dark .msweb-ui.accordion .accordion-header:hover,
[data-theme="dark"] .msweb-ui.accordion .accordion-header:hover {
  background: #2e2e42;
}

.theme-dark .msweb-ui.accordion .accordion-header h2,
[data-theme="dark"] .msweb-ui.accordion .accordion-header h2 {
  color: #e2e8f0;
}

.theme-dark .msweb-ui.accordion .accordion-item,
[data-theme="dark"] .msweb-ui.accordion .accordion-item {
  border-color: #3f3f5c;
}

.theme-dark .msweb-ui.accordion .accordion-item.active>.accordion-header,
[data-theme="dark"] .msweb-ui.accordion .accordion-item.active>.accordion-header {
  background: #2a2a3c;
}

.theme-dark .msweb-ui.tabs-container,
[data-theme="dark"] .msweb-ui.tabs-container {
  background: #2a2a3c;
  border-color: #3f3f5c;
}

.theme-dark .msweb-ui.tabs-container .tabs-header,
[data-theme="dark"] .msweb-ui.tabs-container .tabs-header {
  border-color: #3f3f5c;
  background: #1e1e2e;
}

.theme-dark .msweb-ui.tabs-container .tabs-scroll-btns,
[data-theme="dark"] .msweb-ui.tabs-container .tabs-scroll-btns {
  background: #1e1e2e;
  border-color: #3f3f5c;
}

.theme-dark .msweb-ui.tabs-container .tabs-scroll-btn,
[data-theme="dark"] .msweb-ui.tabs-container .tabs-scroll-btn {
  background: #2a2a3c;
  border-color: #3f3f5c;
  color: #94a3b8;
}

.theme-dark .msweb-ui.tabs-container .tabs-scroll-btn:hover:not(:disabled),
[data-theme="dark"] .msweb-ui.tabs-container .tabs-scroll-btn:hover:not(:disabled) {
  background: #3a3a52;
  color: #e2e8f0;
}

.theme-dark .msweb-ui.tabs-container .tab-btn,
[data-theme="dark"] .msweb-ui.tabs-container .tab-btn {
  color: #94a3b8;
}

.theme-dark .msweb-ui.tabs-container .tab-btn:hover,
[data-theme="dark"] .msweb-ui.tabs-container .tab-btn:hover {
  color: #4f6ef7;
  background-color: rgba(79, 110, 247, 0.08);
}

.theme-dark .msweb-ui.tabs-container .tab-btn.active,
[data-theme="dark"] .msweb-ui.tabs-container .tab-btn.active {
  color: #4f6ef7;
  border-bottom-color: #4f6ef7;
  background-color: #2a2a3c;
}

.theme-dark .msweb-ui .form-label,
.theme-dark .msweb-ui .radio-group-label,
[data-theme="dark"] .msweb-ui .form-label,
[data-theme="dark"] .msweb-ui .radio-group-label {
  color: #94a3b8;
}

.theme-dark .msweb-ui .form-label-inline,
[data-theme="dark"] .msweb-ui .form-label-inline {
  color: #e2e8f0;
}

.theme-dark .msweb-ui .radio-option-wrapper span,
[data-theme="dark"] .msweb-ui .radio-option-wrapper span {
  color: #e2e8f0;
}

.theme-dark .msweb-ui .tooltip-icon,
[data-theme="dark"] .msweb-ui .tooltip-icon {
  background-color: #4f6ef7;
}

.theme-dark .msweb-ui .tooltip-icon:hover,
[data-theme="dark"] .msweb-ui .tooltip-icon:hover {
  background-color: #3b5ae0;
}

.theme-dark .msweb-ui .input-disabled-overlay,
[data-theme="dark"] .msweb-ui .input-disabled-overlay {
  background-color: rgba(0, 0, 0, 0.3);
}

.theme-dark .msweb-ui textarea.textarea-json-mode,
[data-theme="dark"] .msweb-ui textarea.textarea-json-mode {
  background-color: #1e1e2e;
}

.theme-dark .msweb-ui .select2-container--default .select2-selection--single,
[data-theme="dark"] .msweb-ui .select2-container--default .select2-selection--single {
  background-color: #252536 !important;
  border-color: #3f3f5c !important;
  color: #e2e8f0;
}

.theme-dark .msweb-ui .select2-container--default .select2-selection--single .select2-selection__rendered,
[data-theme="dark"] .msweb-ui .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #e2e8f0 !important;
}

.theme-dark .msweb-ui .select2-container--default .select2-selection--single:hover,
[data-theme="dark"] .msweb-ui .select2-container--default .select2-selection--single:hover {
  border-color: #64748b;
}

.theme-dark .msweb-ui .select2-container--default .select2-selection--single:focus,
[data-theme="dark"] .msweb-ui .select2-container--default .select2-selection--single:focus {
  border-color: #4f6ef7;
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.2);
}

.theme-dark .msweb-ui .select2-container--default .select2-selection--multiple,
[data-theme="dark"] .msweb-ui .select2-container--default .select2-selection--multiple {
  background-color: #252536 !important;
  border-color: #3f3f5c !important;
}

.theme-dark .msweb-ui .select2-container--default .select2-selection--multiple .select2-selection__choice,
[data-theme="dark"] .msweb-ui .select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: #3f3f5c !important;
  color: #e2e8f0;
  border-color: #5a5a7a;
}

.theme-dark .msweb-ui {
  /* Выпадающий список Select2: перебиваем .msweb-ui.select2-container .select2-dropdown .select2-results__option { color } */
}

.theme-dark .msweb-ui.select2-container .select2-dropdown .select2-results__option,
[data-theme="dark"] .msweb-ui.select2-container .select2-dropdown .select2-results__option {
  color: #fff;
}

/* Тёмная тема: выпадающий список Select2 (рендерится в body, не внутри .msweb-ui) */
.theme-dark .select2-dropdown {
  background-color: #2a2a3c !important;
  border-color: #3f3f5c !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.theme-dark .select2-dropdown .select2-results__option {
  padding: 8px 12px;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  font-size: 14px;
  transition: background-color 0.15s ease;
  color: #fff;
}

.theme-dark .select2-dropdown .select2-results__option--selectable:hover {
  background-color: #2e2e42;
}

.theme-dark .select2-dropdown .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: #4f6ef7;
  color: #fff;
}

.theme-dark .select2-dropdown .select2-results__option--selected {
  background-color: rgba(79, 110, 247, 0.2);
  color: #4f6ef7;
}

.theme-dark .select2-dropdown .select2-results__option--disabled {
  color: #6b7280;
}

.theme-dark .select2-dropdown .select2-results__option--group,
.theme-dark .select2-dropdown .select2-results__group {
  padding: 8px 12px;
  font-size: 12px;
  color: #6b7280;
}

.theme-dark .select2-dropdown .select2-search--dropdown .select2-search__field {
  background-color: #252536;
  border-color: #3f3f5c;
  color: #e2e8f0;
}

.theme-dark .select2-dropdown .select2-search--dropdown .select2-search__field::-moz-placeholder {
  color: #6b7280;
}

.theme-dark .select2-dropdown .select2-search--dropdown .select2-search__field::placeholder {
  color: #6b7280;
}

/* Дополнительные правила для тёмной темы через data-theme (заполнение gaps для dropdown Select2) */
[data-theme="dark"] .msweb-ui .select2-container--default .select2-selection--single {
  background-color: #252536 !important;
  border-color: #3f3f5c !important;
  color: #e2e8f0;
}

[data-theme="dark"] .msweb-ui .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .msweb-ui .select2-container--default .select2-selection--single:hover {
  border-color: #64748b;
}

[data-theme="dark"] .msweb-ui .select2-container--default .select2-selection--single:focus {
  border-color: #4f6ef7;
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.2);
}

[data-theme="dark"] .msweb-ui.select2-container .select2-dropdown .select2-results__option {
  color: #fff;
}

[data-theme="dark"] .select2-dropdown {
  background-color: #2a2a3c !important;
  border-color: #3f3f5c !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .select2-dropdown .select2-results__option {
  color: #fff;
}

[data-theme="dark"] .select2-dropdown .select2-results__option--selectable:hover {
  background-color: #2e2e42;
}

[data-theme="dark"] .select2-dropdown .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: #4f6ef7;
  color: #fff;
}

[data-theme="dark"] .select2-dropdown .select2-results__option--selected {
  background-color: rgba(79, 110, 247, 0.2);
  color: #4f6ef7;
}

[data-theme="dark"] .select2-dropdown .select2-results__option--disabled {
  color: #6b7280;
}

[data-theme="dark"] .select2-dropdown .select2-results__option--group,
[data-theme="dark"] .select2-dropdown .select2-results__group {
  color: #6b7280;
}

[data-theme="dark"] .select2-dropdown .select2-search--dropdown .select2-search__field {
  background-color: #252536;
  border-color: #3f3f5c;
  color: #e2e8f0;
}

[data-theme="dark"] .select2-dropdown .select2-search--dropdown .select2-search__field::-moz-placeholder {
  color: #6b7280;
}

[data-theme="dark"] .select2-dropdown .select2-search--dropdown .select2-search__field::placeholder {
  color: #6b7280;
}

/* Стили для Select2 dropdown с классом .msweb-ui на контейнере (добавляется автоматически при открытии) */
.msweb-ui.select2-container .select2-dropdown {
  background-color: white !important;
  border: 1px solid #d1d5db !important;
  border-radius: 6px !important;
  box-sizing: border-box;
  display: block;
  position: absolute;
  left: -100000px;
  width: 100%;
  z-index: 1051;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04) !important;
  margin-top: 4px;
}

.msweb-ui.select2-container.select2-container--open .select2-dropdown {
  left: 0;
}

.msweb-ui.select2-container.select2-container--open .select2-dropdown--above {
  border-bottom: none;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.msweb-ui.select2-container.select2-container--open .select2-dropdown--below {
  border-top: none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.msweb-ui.select2-container .select2-dropdown .select2-results {
  display: block;
}

.msweb-ui.select2-container .select2-dropdown .select2-results__options {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.msweb-ui.select2-container .select2-dropdown .select2-results__option {
  padding: 8px 12px;
  -moz-user-select: none;
  user-select: none;
  -webkit-user-select: none;
  color: #1e293b;
  font-size: 14px;
  transition: background-color 0.15s ease;
}

.msweb-ui.select2-container .select2-dropdown .select2-results__option--selectable {
  cursor: pointer;
}

.msweb-ui.select2-container .select2-dropdown .select2-results__option--selectable:hover {
  background-color: #f8fafc;
}

.msweb-ui.select2-container .select2-dropdown .select2-results__option--group {
  padding: 8px 12px;
  font-weight: 600;
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.msweb-ui.select2-container .select2-dropdown .select2-results__option--disabled {
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.6;
}

.msweb-ui.select2-container .select2-dropdown .select2-results__option--selected {
  background-color: #e8eeff;
  color: #4f6ef7;
  font-weight: 500;
}

.msweb-ui.select2-container .select2-dropdown .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: #4f6ef7;
  color: white;
}

.msweb-ui.select2-container .select2-dropdown .select2-results__group {
  cursor: default;
  display: block;
  padding: 8px 12px;
  font-weight: 600;
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.msweb-ui.select2-container .select2-dropdown .select2-search--dropdown {
  display: block;
  padding: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.msweb-ui.select2-container .select2-dropdown .select2-search--dropdown .select2-search__field {
  padding: 8px 12px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #1e293b;
  background-color: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.msweb-ui.select2-container .select2-dropdown .select2-search--dropdown .select2-search__field:focus {
  outline: none;
  border-color: #4f6ef7;
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.3);
}

.msweb-ui.select2-container .select2-dropdown .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.msweb-ui.select2-container .select2-dropdown .select2-search--dropdown.select2-search--hide {
  display: none;
}

.msweb-ui.select2-container .select2-dropdown .select2-results>.select2-results__options {
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.msweb-ui.select2-container .select2-dropdown .select2-results>.select2-results__options::-webkit-scrollbar {
  width: 8px;
}

.msweb-ui.select2-container .select2-dropdown .select2-results>.select2-results__options::-webkit-scrollbar-track {
  background: transparent;
}

.msweb-ui.select2-container .select2-dropdown .select2-results>.select2-results__options::-webkit-scrollbar-thumb {
  background-color: #d1d5db;
  border-radius: 4px;
}

/* Fix: тёмная тема select2 — перебиваем !important из light-theme правил */
[data-theme="dark"] .msweb-ui.select2-container .select2-dropdown {
  background-color: #2a2a3c !important;
  border-color: #3f3f5c !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .msweb-ui.select2-container .select2-dropdown .select2-results__option--selectable:hover {
  background-color: #2e2e42 !important;
}

[data-theme="dark"] .msweb-ui.select2-container .select2-dropdown .select2-search--dropdown .select2-search__field {
  background-color: #252536 !important;
  border-color: #3f3f5c !important;
  color: #e2e8f0 !important;
}

span.select2-container.select2-container--default.select2-container--open.msweb-ui {
  z-index: 11111;
}

/* ===== ContextMenu ===== */
.msweb-ui.ctx-menu {
  position: fixed;
  background: var(--ctx-bg, #fff);
  border: 1px solid var(--ctx-border, #e2e5eb);
  border-radius: 8px;
  padding: 4px;
  min-width: 180px;
  box-shadow: 0 8px 30px var(--ctx-shadow, rgba(0, 0, 0, 0.12));
  z-index: 10000;
  display: none;
  font-size: 13px;
}

.msweb-ui.ctx-menu.show {
  display: block;
}

.ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 5px;
  cursor: pointer;
  color: var(--ctx-text, #1e293b);
  transition: background 0.1s;
}

.ctx-item:hover {
  background: var(--ctx-hover, #f0f2f5);
}

.ctx-item.danger {
  color: var(--ctx-danger, #dc2626);
}

.ctx-item i {
  width: 14px;
  text-align: center;
  font-size: 13px;
  flex-shrink: 0;
}

.ctx-sep {
  height: 1px;
  background: var(--ctx-border, #e2e5eb);
  margin: 3px 6px;
}

.ctx-sub-wrapper {
  position: relative;
}

.ctx-submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  background: var(--ctx-bg, #fff);
  border: 1px solid var(--ctx-border, #e2e5eb);
  border-radius: 8px;
  padding: 4px;
  min-width: 160px;
  box-shadow: 0 8px 30px var(--ctx-shadow, rgba(0, 0, 0, 0.12));
  z-index: 10001;
}

.ctx-submenu.show {
  display: block;
}

/* ===== TreeView ===== */
.tree-view {
  font-size: 13px;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  overflow-y: auto;
  height: 100%;
}

.tree-list {
  display: flex;
  flex-direction: column;
}

@keyframes tree-highlight-pulse {

  0%,
  100% {
    background: transparent;
  }

  50% {
    background: rgba(34, 197, 94, 0.25);
  }
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  cursor: pointer;
  border-radius: 4px;
  min-height: 26px;
  transition: background 0.1s;
}

.tree-row:hover {
  background: var(--tree-hover, rgba(99, 102, 241, 0.08));
}

.tree-row.selected {
  background: var(--tree-selected, rgba(99, 102, 241, 0.15));
}

.tree-row.tree-dragging {
  opacity: 0.5;
}

.tree-row.tree-drag-over {
  background: var(--tree-selected, rgba(99, 102, 241, 0.2));
  outline: 1px dashed var(--accent, #6366f1);
  outline-offset: -1px;
}

.tree-row.tree-highlight {
  animation: tree-highlight-pulse 0.5s ease-in-out 2;
}

.tree-chevron {
  width: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  opacity: 0.6;
}

.tree-chevron:hover {
  opacity: 1;
}

.tree-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.tree-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.tree-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  font-weight: 600;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.tree-rename-input {
  flex: 1;
  background: var(--tree-input-bg, #fff);
  border: 1px solid var(--tree-input-border, #6366f1);
  border-radius: 4px;
  color: inherit;
  font-family: inherit;
  font-size: 13px;
  padding: 1px 4px;
  outline: none;
}

/* --- Flex-система для канваса (flex1 = 1/24, flex2 = 2/24, ... flex24 = 24/24) --- */
.flex1 {
  flex: 1 1 0;
  min-width: 0;
}

.flex2 {
  flex: 2 1 0;
  min-width: 0;
}

.flex3 {
  flex: 3 1 0;
  min-width: 0;
}

.flex4 {
  flex: 4 1 0;
  min-width: 0;
}

.flex5 {
  flex: 5 1 0;
  min-width: 0;
}

.flex6 {
  flex: 6 1 0;
  min-width: 0;
}

.flex7 {
  flex: 7 1 0;
  min-width: 0;
}

.flex8 {
  flex: 8 1 0;
  min-width: 0;
}

.flex9 {
  flex: 9 1 0;
  min-width: 0;
}

.flex10 {
  flex: 10 1 0;
  min-width: 0;
}

.flex11 {
  flex: 11 1 0;
  min-width: 0;
}

.flex12 {
  flex: 12 1 0;
  min-width: 0;
}

.flex13 {
  flex: 13 1 0;
  min-width: 0;
}

.flex14 {
  flex: 14 1 0;
  min-width: 0;
}

.flex15 {
  flex: 15 1 0;
  min-width: 0;
}

.flex16 {
  flex: 16 1 0;
  min-width: 0;
}

.flex17 {
  flex: 17 1 0;
  min-width: 0;
}

.flex18 {
  flex: 18 1 0;
  min-width: 0;
}

.flex19 {
  flex: 19 1 0;
  min-width: 0;
}

.flex20 {
  flex: 20 1 0;
  min-width: 0;
}

.flex21 {
  flex: 21 1 0;
  min-width: 0;
}

.flex22 {
  flex: 22 1 0;
  min-width: 0;
}

.flex23 {
  flex: 23 1 0;
  min-width: 0;
}

.flex24 {
  flex: 24 1 0;
  min-width: 0;
}

/* ─── FormField: модификаторы label ──────────────────────── */

.form-group--label-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group--label-left>label {
  flex-shrink: 0;
  margin-bottom: 0;
  white-space: nowrap;
}

.form-group--label-left>.input-wrapper {
  flex: 1;
  min-width: 0;
}

/* ══════════════════════════════════════════════════════════════
   ГЛОБАЛЬНАЯ ПОДДЕРЖКА [data-theme="dark"] ДЛЯ ВСЕХ КОМПОНЕНТОВ
   ══════════════════════════════════════════════════════════════ */

/* Модальные окна и диалоги */
[data-theme="dark"] .msweb-ui.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .msweb-ui.modal-small {
  background: #2a2a3c;
  color: #e2e8f0;
  border: 1px solid #3f3f5c;
}

[data-theme="dark"] .msweb-ui.modal-small h3 {
  color: #e2e8f0;
}

[data-theme="dark"] .msweb-ui.modal-small>.buttons {
  background: #1e1e2e;
  border-color: #3f3f5c;
}

[data-theme="dark"] .msweb-ui.modal-small > .msweb-ui.modal-body,
[data-theme="dark"] .msweb-ui.modal-wide > .msweb-ui.modal-body {
  background: #2a2a3c;
  color: #e2e8f0;
}

[data-theme="dark"] .msweb-ui.alert-title {
  border-color: #3f3f5c;
}

[data-theme="dark"] .msweb-ui.alert-message {
  color: #94a3b8;
}

/* Аккордион */
[data-theme="dark"] .msweb-ui.accordion {
  background: #2a2a3c;
  border-color: #3f3f5c;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .msweb-ui.accordion .accordion-header {
  background: #1e1e2e;
}

[data-theme="dark"] .msweb-ui.accordion .accordion-header:hover {
  background: #2e2e42;
}

[data-theme="dark"] .msweb-ui.accordion .accordion-header h2 {
  color: #e2e8f0;
}

[data-theme="dark"] .msweb-ui.accordion .accordion-item {
  border-color: #3f3f5c;
}

[data-theme="dark"] .msweb-ui.accordion .accordion-item.active>.accordion-header {
  background: #2a2a3c;
}

/* DataTables dark theme — [data-theme="dark"] context */
[data-theme="dark"] .msweb-ui .dt-container table.dataTable thead th,
[data-theme="dark"] .msweb-ui .dt-container table.dataTable thead td {
  background-color: #0f172a;
  color: #f1f5f9;
  border-color: #334155;
}

[data-theme="dark"] .msweb-ui .dt-container table.dataTable tbody td,
[data-theme="dark"] .msweb-ui .dt-container table.dataTable tbody th,
[data-theme="dark"] .msweb-ui .dt-container table.dataTable tfoot td,
[data-theme="dark"] .msweb-ui .dt-container table.dataTable tfoot th {
  color: #cbd5e1;
  border-color: #334155;
}

[data-theme="dark"] .msweb-ui .dt-container table.dataTable tfoot th,
[data-theme="dark"] .msweb-ui .dt-container table.dataTable tfoot td {
  background-color: #0f172a;
  color: #f1f5f9;
}

[data-theme="dark"] .msweb-ui.ui-component div.dt-container .dt-length,
[data-theme="dark"] .msweb-ui.ui-component div.dt-container .dt-search,
[data-theme="dark"] .msweb-ui.ui-component div.dt-container .dt-info,
[data-theme="dark"] .msweb-ui.ui-component div.dt-container .dt-processing,
[data-theme="dark"] .msweb-ui.ui-component div.dt-container .dt-paging { color: #cbd5e1; }

[data-theme="dark"] .msweb-ui.ui-component div.dt-container .dt-length label,
[data-theme="dark"] .msweb-ui.ui-component div.dt-container .dt-search label { color: #cbd5e1; }

[data-theme="dark"] .msweb-ui.ui-component div.dt-container .dt-length input,
[data-theme="dark"] .msweb-ui.ui-component div.dt-container .dt-search input {
  background-color: #0f172a;
  color: #e2e8f0;
  border-color: #334155;
}

[data-theme="dark"] .msweb-ui.ui-component div.dt-container .dt-paging .dt-paging-button {
  background-color: #0f172a;
  color: #cbd5e1 !important;
  border-color: #334155;
}

[data-theme="dark"] .msweb-ui.ui-component div.dt-container .dt-paging .dt-paging-button:hover {
  background-color: #1e293b;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .msweb-ui.ui-component div.dt-container .dt-paging .dt-paging-button.current,
[data-theme="dark"] .msweb-ui.ui-component div.dt-container .dt-paging .dt-paging-button.current:hover {
  background-color: #1e40af;
  color: #fff !important;
}

[data-theme="dark"] .msweb-ui.ui-component div.dt-container .dt-paging .dt-paging-button.disabled {
  background-color: #0f172a;
  color: #64748b !important;
  opacity: 0.5;
}

/* Output и прочие текстовые элементы */
[data-theme="dark"] .msweb-ui .textarea-error-message {
  color: #f87171;
  background: #451a1a;
  border: 1px solid #7f1d1d;
  border-left-width: 3px;
}

/* --- ProgressBar --- */
@keyframes msweb-pb-shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(200%);
  }
}

.msweb-progress-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  min-width: 160px;
}

.msweb-progress-bar.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.msweb-progress-bar.is-leaving {
  opacity: 0;
  transform: translateY(-4px);
}

.msweb-progress-bar.pb-inline {
  position: static;
  box-shadow: none;
  border: none;
  border-top: 1px solid #e2e8f0;
  border-radius: 0;
  padding: 6px 0 0;
  background: transparent;
}

.msweb-pb-label {
  font-size: 11px;
  line-height: 1.3;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.msweb-pb-track {
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: #e2e8f0;
  overflow: hidden;
  position: relative;
}

.msweb-pb-fill {
  height: 100%;
  border-radius: 3px;
  background: #4f6ef7;
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
}

/* Indeterminate: shimmer поверх fill */
.msweb-progress-bar.is-indeterminate .msweb-pb-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 50%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
  animation: msweb-pb-shimmer 1.4s infinite linear;
  border-radius: 3px;
}

/* Статусные цвета */
.msweb-progress-bar.pb-status-success .msweb-pb-fill {
  background: #22c55e;
}

.msweb-progress-bar.pb-status-error .msweb-pb-fill {
  background: #ef4444;
}

.msweb-progress-bar.pb-status-warning .msweb-pb-fill {
  background: #f59e0b;
}

.msweb-progress-bar.pb-status-default .msweb-pb-fill {
  background: #4f6ef7;
}

/* Dark theme */
[data-theme="dark"] .msweb-progress-bar {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .msweb-progress-bar.pb-inline {
  background: transparent;
  border-color: #334155;
}

[data-theme="dark"] .msweb-pb-label {
  color: #94a3b8;
}

[data-theme="dark"] .msweb-pb-track {
  background: #334155;
}

/* --- Breadcrumbs (хлебные крошки) --- */
.msweb-ui.breadcrumbs {
  display: block;
}

.breadcrumbs__list {
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  font-size: 14px;
}

.breadcrumbs__item {
  display: flex;
  align-items: center;
}

.breadcrumbs__item:not(:last-child)::after {
  content: '›';
  margin: 0 7px;
  color: #9ca3af;
  font-size: 16px;
  line-height: 1;
}

.breadcrumbs__link {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  font-family: inherit;
  color: #2563eb;
  cursor: pointer;
  line-height: 1.4;
}

.breadcrumbs__link:hover {
  text-decoration: underline;
}

.breadcrumbs__current {
  color: #374151;
  font-weight: 600;
  line-height: 1.4;
}

/* --- SegmentedControl (сегментированный переключатель) --- */
.msweb-ui.segmented-control {
  display: inline-flex;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.segmented-control-btn {
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-right: 1px solid #e5e7eb;
  cursor: pointer;
  background: #fff;
  color: #374151;
  font-family: inherit;
  transition: background .15s, color .15s;
  line-height: 1.4;
}

.segmented-control-btn:last-child {
  border-right: none;
}

.segmented-control-btn:hover:not(.is-active) {
  background: #f9fafb;
}

.segmented-control-btn.is-active {
  background: #2563eb;
  color: #fff;
}

.theme-dark .msweb-ui.segmented-control,
[data-theme="dark"] .msweb-ui.segmented-control {
  border-color: #334155;
  background: #0f172a;
}

.theme-dark .segmented-control-btn,
[data-theme="dark"] .segmented-control-btn {
  background: #0f172a;
  color: #cbd5e1;
  border-right-color: #334155;
}

.theme-dark .segmented-control-btn:hover:not(.is-active),
[data-theme="dark"] .segmented-control-btn:hover:not(.is-active) {
  background: #172036;
  color: #e2e8f0;
}

.theme-dark .segmented-control-btn.is-active,
[data-theme="dark"] .segmented-control-btn.is-active {
  background: #2563eb;
  color: #fff;
}

/* --- CodeBlock (блок кода с кнопкой копирования) --- */
.msweb-ui.code-block {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
}

.code-block-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  background: #0f172a;
  padding: 6px 10px;
  border-bottom: 1px solid #1e293b;
}

.code-block-copy-btn {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
  font-family: inherit;
  transition: color .15s, border-color .15s;
}

.code-block-copy-btn:hover {
  color: #e2e8f0;
  border-color: #64748b;
}

.code-block-copy-btn.is-copied {
  color: #4ade80;
  border-color: #4ade80;
}

.code-block-pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px 16px;
  font-size: 12px;
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}


.dt-topbar {
  display: flex;
  gap: 16px;
  padding: 8px;
  border-radius: 8px;
  background: rgb(152 202 255 / 13%);
}

.dt-topbar div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgb(152 202 255 / 13%);

}

/* ── Кастомные контролы DataTables (замена нативных l/f) ─────────────── */
.dt-topbar .dt-controls-length,
.dt-topbar .dt-controls-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: none;
  border-radius: 0;
}

.dt-topbar .dt-controls-search {
  margin-left: auto;
  width: 260px;
  flex-shrink: 0;
}

.dt-topbar .dt-controls-length .select-component-wrapper {
  width: 70px;
  min-width: 70px;
}

.dt-topbar .dt-controls-length span {
  font-size: 14px;
  white-space: nowrap;
  color: #374151;
}

/* .input-wrapper внутри dt-topbar: display:block, чтобы не наследовать display:flex
   от правила .dt-topbar div; width:100% — заполнить контейнер .dt-controls-search */
.dt-topbar .input-wrapper {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border-radius: 0;
}

.dt-topbar .select-component-wrapper {
  padding: 0;
  background: none;
  border-radius: 0;
}

/* Общий класс .input-wrapper всегда width:100% */
.msweb-ui.ui-component.input-wrapper {
  width: 100%;
}

.dt-length label {
  display: flex;
  align-items: center;
  gap: 8px;

}

input.msweb-ui.ui-component[readonly] {
    background: #f1f1f1;
}
