/* ============================================================================
   Основные стили ЖКХ-платформы
   Дизайн: "ламповый", современный, удобный для людей старшего возраста
   ============================================================================ */

:root {
  --font-ui: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  /* Основная палитра - теплые и мягкие цвета */
  --color-primary: #4a90a4;      /* Мягкий голубой */
  --color-primary-light: #7ab3cc; /* Светлый голубой */
  --color-primary-dark: #2d5a6f; /* Темный голубой */
  
  --color-accent: #6bb896;        /* Мягкий зеленый */
  --color-accent-light: #a5d8b5; /* Светлый зеленый */
  
  --color-warning: #e8a75d;       /* Теплый оранжевый */
  --color-danger: #d97e79;        /* Мягкий красный */
  --color-success: #6bb896;       /* Зеленый */
  
  --color-bg: #faf9f7;            /* Теплый белый фон */
  --color-bg-secondary: #f3f1ee; /* Чуть более темный фон */
  --color-text-primary: #3a3a3a; /* Темный текст */
  --color-text-secondary: #707070; /* Серый текст */
  --color-border: #e8e8e8;        /* Легкие границы */
  
  --color-white: #ffffff;

  --domig-runtime-menu-logo-scale: 1;
  --domig-runtime-footer-logo-scale: 1;
  
  /* Тени */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  
  /* Переходы */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Размеры */
  --border-radius: 12px;
  --border-radius-lg: 16px;
}

/* ============================================================================
   Базовые стили
   ============================================================================ */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html.domig-reduced-motion {
  scroll-behavior: auto;
}

html.domig-reduced-motion *,
html.domig-reduced-motion *::before,
html.domig-reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

body {
  font-family: var(--font-ui);
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.logo,
.landing-logo {
  --domig-runtime-logo-text-size: 20px;
  --domig-runtime-logo-icon-size: 28px;
}

.logo .logo-icon,
.landing-logo .logo-icon {
  font-size: calc(var(--domig-runtime-logo-icon-size, 28px) * var(--domig-runtime-menu-logo-scale, 1));
}

.logo .logo-text,
.landing-logo .logo-text {
  font-size: calc(var(--domig-runtime-logo-text-size, 20px) * var(--domig-runtime-menu-logo-scale, 1));
  line-height: 1;
}

.logo-icon .domig-runtime-logo,
.logo > .domig-runtime-logo {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.logo.domig-runtime-brand--custom,
.landing-logo.domig-runtime-brand--custom {
  gap: 0;
}

.logo.domig-runtime-brand--custom .logo-icon,
.logo.domig-runtime-brand--custom .logo-text,
.landing-logo.domig-runtime-brand--custom .logo-icon,
.landing-logo.domig-runtime-brand--custom .logo-text {
  display: none;
}

.logo .domig-runtime-logo--menu,
.landing-logo .domig-runtime-logo--menu {
  display: block;
  width: auto;
  height: calc(44px * var(--domig-runtime-menu-logo-scale, 1));
  max-width: min(260px, 62vw);
  object-fit: contain;
}

@media (max-width: 640px) {
  .logo .domig-runtime-logo--menu,
  .landing-logo .domig-runtime-logo--menu {
    height: calc(38px * var(--domig-runtime-menu-logo-scale, 1));
    max-width: min(220px, 68vw);
  }
}

/* ============================================================================
   Компоненты UI
   ============================================================================ */

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
  gap: 8px;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-border);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.btn-success {
  background-color: var(--color-success);
  color: var(--color-white);
}

.btn-success:hover {
  background-color: #5a9d85;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.btn-warning {
  background-color: var(--color-warning);
  color: var(--color-white);
}

.btn-warning:hover {
  background-color: #d69050;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.btn-danger {
  background-color: var(--color-danger);
  color: var(--color-white);
}

.btn-danger:hover {
  background-color: #c85f59;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: var(--shadow-md);
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
}

.btn-large {
  padding: 16px 32px;
  font-size: 18px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

body .notification-container {
  position: fixed;
  top: var(--domig-toast-top-offset, 20px);
  right: 20px;
  z-index: 2147483000;
  width: min(420px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  pointer-events: none;
}

body .notification-container.is-top-left {
  left: 20px;
  right: auto;
}

body .notification-container.is-top-center {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

body .notification-container.is-bottom-right {
  top: auto;
  bottom: var(--domig-toast-bottom-offset, 20px);
}

body .notification-container.is-bottom-left {
  top: auto;
  left: 20px;
  right: auto;
  bottom: var(--domig-toast-bottom-offset, 20px);
}

body .notification-container.is-bottom-center {
  top: auto;
  left: 50%;
  right: auto;
  bottom: var(--domig-toast-bottom-offset, 20px);
  transform: translateX(-50%);
}

.domig-nav-overflow {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.domig-nav-overflow[hidden] {
  display: none !important;
}

.domig-nav-overflow-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 40px;
  padding: 0 6px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.domig-nav-overflow-trigger:hover,
.domig-nav-overflow-trigger:focus-visible,
.domig-nav-overflow-trigger[aria-expanded="true"] {
  outline: none;
  transform: translateY(-1px);
  background: transparent;
  box-shadow: none;
}

.domig-nav-overflow-trigger-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  font-size: 26px;
  font-weight: 700;
  line-height: 0.7;
  letter-spacing: 0.06em;
  transform: translateY(-2px);
  pointer-events: none;
}

.domig-nav-overflow-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 10130;
  min-width: min(280px, calc(100vw - 32px));
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(31, 42, 46, 0.1);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.14);
}

.domig-nav-overflow-menu.hidden {
  display: none;
}

.domig-nav-overflow-menu > li {
  list-style: none;
  width: 100%;
}

.domig-nav-overflow-menu .nav-link,
.domig-nav-overflow-menu .admin-nav-link {
  width: 100%;
}

body .notification-container .notification.domig-toast {
  background: var(--domig-toast-background, var(--color-white));
  color: var(--domig-toast-text, var(--color-text-primary));
  border-radius: 20px;
  border-left: 4px solid var(--domig-toast-accent, var(--color-primary));
  padding: 16px 18px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  animation: slideInRight 0.22s ease;
  pointer-events: auto;
}

body .notification-container.is-top-left .notification.domig-toast,
body .notification-container.is-bottom-left .notification.domig-toast {
  animation-name: slideInLeft;
}

body .notification-container.is-top-center .notification.domig-toast {
  animation-name: slideInDown;
}

body .notification-container.is-bottom-center .notification.domig-toast,
body .notification-container.is-bottom-right .notification.domig-toast,
body .notification-container.is-bottom-left .notification.domig-toast {
  animation-name: slideInUp;
}

body .notification-container .notification.domig-toast.is-leaving {
  animation: fadeOutToast 0.2s ease forwards;
}

body .notification-container .notification.domig-toast--compact {
  padding: 12px 14px;
  border-radius: 16px;
}

body .notification-container .notification.domig-toast--compact .notification-title {
  font-size: 13px;
}

body .notification-container .notification.domig-toast--compact .notification-message {
  font-size: 12px;
}

body .notification-container .notification.domig-toast--large {
  padding: 18px 20px;
  border-radius: 22px;
}

body .notification-container .notification.domig-toast--large .notification-title {
  font-size: 16px;
}

body .notification-container .notification.domig-toast--large .notification-message {
  font-size: 14px;
}

@keyframes slideInRight {
  from {
    transform: translate3d(28px, 0, 0);
    opacity: 0;
  }

  to {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    transform: translate3d(-28px, 0, 0);
    opacity: 0;
  }

  to {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

@keyframes slideInDown {
  from {
    transform: translate3d(0, -20px, 0);
    opacity: 0;
  }

  to {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    transform: translate3d(0, 20px, 0);
    opacity: 0;
  }

  to {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

@keyframes fadeOutToast {
  from {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }

  to {
    transform: translate3d(0, -10px, 0);
    opacity: 0;
  }
}

body .notification-container .notification.domig-toast .notification-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--domig-toast-accent, var(--color-primary)) 12%, #ffffff);
  color: var(--domig-toast-accent, var(--color-primary));
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

body .notification-container .notification.domig-toast .notification-content {
  flex: 1;
  min-width: 0;
}

body .notification-container .notification.domig-toast .notification-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 4px;
  color: var(--domig-toast-text, var(--color-text-primary));
}

body .notification-container .notification.domig-toast .notification-message {
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  color: color-mix(in srgb, var(--domig-toast-text, var(--color-text-primary)) 88%, #ffffff);
}

body .notification-container .notification.domig-toast .notification-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--domig-toast-text, var(--color-text-primary)) 72%, #ffffff);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px;
  border-radius: 10px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body .notification-container .notification.domig-toast .notification-close:hover {
  background: rgba(15, 23, 42, 0.08);
  color: var(--domig-toast-text, var(--color-text-primary));
}

body .operator-mode-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  gap: 6px;
  min-width: 240px;
  padding: 10px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(31, 42, 46, 0.1);
  box-shadow: 0 20px 38px rgba(15, 23, 42, 0.14);
  z-index: 30;
  max-height: none;
  overflow-y: visible;
}

body .operator-mode-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

body .operator-mode-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  padding: 4px;
  border-radius: 22px;
  background: rgba(14, 24, 26, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 28px rgba(8, 14, 16, 0.18);
  backdrop-filter: blur(18px);
}

body .operator-mode-bar[data-menu-backdrop='false'] .operator-mode-controls {
  padding: 4px;
  border-radius: 22px;
  background: rgba(14, 24, 26, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 28px rgba(8, 14, 16, 0.16);
}

body .operator-mode-bar[data-menu-backdrop='false'] .dwork-shortcut-btn,
body .operator-mode-bar[data-menu-backdrop='false'] .operator-mode-button {
  border-color: transparent;
}

body .operator-mode-dropdown {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

body .dwork-shortcuts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-right: 4px;
  margin-right: 2px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

body .dwork-shortcut-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: #f1f6f4;
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
  transition: transform 0.18s ease, color 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

body .dwork-shortcut-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  line-height: 0;
}

body .dwork-shortcut-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.85;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body .dwork-shortcut-btn:hover,
body .dwork-shortcut-btn:focus-visible,
body .dwork-shortcut-btn:active {
  outline: none;
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: none;
}

body .dwork-shortcut-btn[aria-disabled='true'],
body .dwork-shortcut-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  background: transparent;
  color: rgba(241, 246, 244, 0.52);
}

body .dwork-shortcut-btn[aria-disabled='true']:hover,
body .dwork-shortcut-btn[aria-disabled='true']:focus-visible,
body .dwork-shortcut-btn:disabled:hover,
body .dwork-shortcut-btn:disabled:focus-visible {
  transform: none;
  background: transparent;
  color: rgba(241, 246, 244, 0.52);
  box-shadow: none;
}

body .operator-mode-button {
  min-width: 132px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 40px;
  padding: 6px 14px;
  font-weight: 700;
  border: none;
  border-radius: 16px;
  background: transparent;
  color: #f1f6f4;
  box-shadow: none;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

body .operator-mode-controls .operator-mode-button.btn,
body .operator-mode-controls .operator-mode-button.btn-secondary {
  border: none !important;
  background: transparent !important;
  color: #f1f6f4;
  box-shadow: none !important;
}

body .operator-mode-button:hover,
body .operator-mode-button:focus-visible {
  outline: none;
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
}

body .operator-mode-button-label,
body .operator-mode-button-timer {
  display: block;
  line-height: 1.1;
}

body .operator-mode-button-timer {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

body .operator-mode-pending {
  max-width: 180px;
  text-align: center;
  color: #627174;
  font-size: 13px;
}

body .operator-mode-button[data-mode-tone="ready"] {
  color: #e5f7eb;
}

body .operator-mode-button[data-mode-tone="manual"],
body .operator-mode-button[data-mode-tone="duty"] {
  color: #e4efff;
}

body .operator-mode-button[data-mode-tone="personal"] {
  color: #ffe8e3;
}

body .operator-mode-button[data-mode-tone="extra-activity"],
body .operator-mode-button[data-mode-tone="meetings"],
body .operator-mode-button[data-mode-tone="training"],
body .operator-mode-button[data-mode-tone="mentoring"],
body .operator-mode-button[data-mode-tone="rotation"] {
  color: #e6f7ec;
}

body .operator-mode-button[data-mode-tone="complex-case"] {
  color: #ffe9dc;
}

body .operator-mode-button[data-mode-tone="overtime"] {
  color: #fff3d3;
}

body .operator-mode-button[data-mode-tone="offline"] {
  color: #ecebfb;
}

@media (max-width: 640px) {
  body .notification-container {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
  }
}

body .operator-mode-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(31, 42, 46, 0.08);
  border-radius: 12px;
  background: #f7f9f8;
  color: #1f2a2e;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

body .operator-mode-option[data-mode-tone="ready"] {
  background: #edf9f1;
}

body .operator-mode-option[data-mode-tone="manual"],
body .operator-mode-option[data-mode-tone="duty"] {
  background: #eef6ff;
}

body .operator-mode-option[data-mode-tone="personal"] {
  background: #fff1ed;
}

body .operator-mode-option[data-mode-tone="extra-activity"],
body .operator-mode-option[data-mode-tone="meetings"],
body .operator-mode-option[data-mode-tone="training"],
body .operator-mode-option[data-mode-tone="mentoring"],
body .operator-mode-option[data-mode-tone="rotation"] {
  background: #edf9f1;
}

body .operator-mode-option[data-mode-tone="complex-case"] {
  background: #fff2e9;
}

body .operator-mode-option[data-mode-tone="overtime"] {
  background: #fff8e0;
}

body .operator-mode-option[data-mode-tone="offline"] {
  background: #f2f0fd;
}

body .operator-mode-option.active,
body .operator-mode-option.is-active,
body .operator-mode-option:hover {
  background: #eaf3f1;
  border-color: rgba(46, 94, 91, 0.24);
}

html.domig-compact-ui .metric-card,
html.domig-compact-ui .card,
html.domig-compact-ui .chart-panel,
html.domig-compact-ui .admin-card,
html.domig-compact-ui .ticket-detail-panel,
html.domig-compact-ui .tickets-panel,
html.domig-compact-ui .operator-task-summary,
html.domig-compact-ui .operator-chat-panel,
html.domig-compact-ui .company-ticket-handler,
html.domig-compact-ui .company-profile-panel {
  padding: 18px !important;
}

html.domig-compact-ui .section-header,
html.domig-compact-ui .panel-actions,
html.domig-compact-ui .filters-bar,
html.domig-compact-ui .ticket-toolbar-panel {
  margin-bottom: 14px;
}

body .operator-task-shell .operator-ticket-actions,
body .operator-task-layout .operator-ticket-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 0;
  margin-bottom: 0;
  align-content: start;
  align-items: stretch;
  width: max-content;
  max-width: 100%;
}

body .operator-task-shell .operator-ticket-actions .is-selected,
body .operator-task-layout .operator-ticket-actions .is-selected {
  box-shadow: inset 0 0 0 2px rgba(46, 94, 91, 0.3);
}

body .operator-task-shell .operator-ticket-actions .btn,
body .operator-task-layout .operator-ticket-actions .btn {
  width: auto;
  max-width: 100%;
}

.domig-alert-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
}

.domig-alert-modal.hidden {
  display: none;
}

.domig-alert-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 16, 19, 0.48);
  backdrop-filter: blur(10px);
}

.domig-alert-modal__panel {
  position: relative;
  width: min(460px, calc(100vw - 32px));
  margin: min(12vh, 96px) auto 0;
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(31, 42, 46, 0.08);
  background: #fff;
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.18);
}

.domig-alert-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.domig-alert-modal__title {
  margin: 0;
  color: #1f2a2e;
  font-size: 22px;
  line-height: 1.2;
}

.domig-alert-modal__close {
  border: none;
  background: transparent;
  color: #667572;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  padding: 0;
}

.domig-alert-modal__body {
  color: #415153;
  font-size: 15px;
  line-height: 1.6;
}

.domig-alert-modal__body strong {
  color: #1f2a2e;
}

.domig-alert-modal__actions {
  display: flex;
  justify-content: flex-end;
}

body.domig-alert-modal-open {
  overflow: hidden;
}

.domig-action-popover {
  position: fixed;
  z-index: 1450;
  width: min(240px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
}

.domig-action-popover.hidden {
  display: none;
}

.domig-action-popover__panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(31, 42, 46, 0.12);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.16);
}

.domig-action-popover__copy {
  display: grid;
  gap: 4px;
}

.domig-action-popover__copy strong,
.domig-action-popover__copy p {
  margin: 0;
}

.domig-action-popover__copy p {
  color: #556468;
  font-size: 13px;
  line-height: 1.45;
}

.domig-action-popover__actions {
  display: grid;
  gap: 8px;
}

body .operator-task-tabs {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 6px;
}

body .operator-task-tabs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #4d5d60;
  font-size: 13px;
}

body .operator-task-tabs-head strong {
  color: #1f2a2e;
  font-size: 14px;
}

body .operator-task-tabs-track {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-top: 0;
  padding-bottom: 0;
}

body .operator-task-tab-shell {
  position: relative;
  display: flex;
  flex: 0 0 auto;
}

body .operator-task-tab {
  position: relative;
  width: 240px;
  min-width: 240px;
  max-width: 240px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(31, 42, 46, 0.1);
  background: #ffffff;
  color: #1f2a2e;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.035);
  cursor: pointer;
  text-align: left;
}

body .operator-task-tab:focus-visible,
body .operator-task-tab-close:focus-visible {
  outline: 2px solid rgba(27, 101, 90, 0.48);
  outline-offset: 2px;
}

body .operator-task-tab--compact {
  width: 240px;
  min-width: 240px;
  max-width: 240px;
  min-height: 40px;
  justify-content: center;
  gap: 0;
  padding: 8px 12px;
  box-shadow: none;
}

body .operator-task-tab--compact-rich {
  width: 240px;
  min-width: 240px;
  max-width: 240px;
  min-height: 58px;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 12px;
}

body .operator-task-tab--closable {
  padding-right: 40px;
}

body .operator-task-tab-close {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: rgba(31, 42, 46, 0.08);
  color: #445255;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

body .operator-task-tab-close:hover {
  background: rgba(31, 42, 46, 0.14);
}

body .operator-task-tab:hover {
  border-color: rgba(46, 94, 91, 0.24);
}

body .operator-task-tab.active {
  background: linear-gradient(135deg, #edf9f1 0%, #f9fffb 100%);
  border-color: rgba(46, 94, 91, 0.28);
  box-shadow: 0 12px 26px rgba(46, 94, 91, 0.1);
}

body .operator-task-tab--compact.active {
  box-shadow: none;
}

body .admin-ticket-card {
  border: 1px solid rgba(31, 42, 46, 0.08);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  margin-bottom: 12px;
  background: #fff;
}

body .admin-ticket-card strong {
  display: block;
  margin-bottom: 8px;
}

body .admin-ticket-card-meta {
  margin-top: 8px;
}

body .admin-ticket-card.active,
body .admin-ticket-card.is-active {
  border-color: #2e5e5b;
  background: #edf6f5;
}

body .admin-ticket-subline {
  color: #4f5e62;
  font-weight: 600;
}

body .admin-ticket-description {
  padding-top: 0;
  color: #36484c;
  line-height: 1.4;
}

body .operator-search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

body .operator-search-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

body .operator-search-header h3,
body .operator-search-header p {
  margin: 0;
}

body .operator-search-detail-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body .operator-task-tab.is-preview {
  background: linear-gradient(135deg, #f8fafb 0%, #ffffff 100%);
  border-style: dashed;
}

body .operator-task-tab-close {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: rgba(31, 42, 46, 0.08);
  color: #5d6b6d;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

body .operator-task-tab-close:hover {
  background: rgba(31, 42, 46, 0.16);
  color: #1f2a2e;
}

body .operator-task-tab-kind {
  color: #627174;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body .operator-task-tab-title {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
}

body .operator-task-tab-meta {
  color: #627174;
  font-size: 12px;
}

body .operator-task-tab-label {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

body .operator-task-tab-label::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 28px;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #ffffff 100%);
}

body .operator-task-tab.active .operator-task-tab-label::after {
  background: linear-gradient(90deg, rgba(249, 255, 251, 0) 0%, #f9fffb 100%);
}

body .operator-task-tab-compact-meta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body .operator-task-tab-compact-state,
body .operator-task-tab-compact-timer {
  color: #627174;
  font-size: 12px;
  line-height: 1.2;
}

body .operator-task-tab-compact-state {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body .operator-task-tab-compact-timer {
  flex: 0 0 auto;
  font-weight: 700;
  color: #295957;
}

body .operator-note-editor {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

body .operator-note-editor textarea {
  width: 100%;
  min-height: 96px;
  border-radius: 14px;
  border: 1px solid rgba(31, 42, 46, 0.16);
  padding: 12px 14px;
  resize: vertical;
}

body .operator-note-editor-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

body .operator-notes-block {
  display: grid;
  gap: 10px;
  margin-top: 0;
}

body .operator-notes-toggle {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #f4f7f6;
  border: 1px solid rgba(31, 42, 46, 0.12);
  border-radius: 14px;
  padding: 10px 14px;
  color: #2e5e5b;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

body .operator-notes-toggle::after {
  content: '>';
  font-size: 18px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 0.16s ease;
}

body .operator-notes-toggle:hover,
body .operator-notes-toggle:focus-visible {
  border-color: rgba(46, 94, 91, 0.28);
  box-shadow: 0 10px 24px rgba(46, 94, 91, 0.08);
  background: #eef5f3;
}

body .operator-notes-toggle.expanded::after {
  transform: rotate(90deg);
}

body .operator-notes-content {
  display: grid;
  gap: 10px;
}

body .operator-note-item,
body .operator-note-empty {
  color: #485654;
  font-size: 14px;
  line-height: 1.45;
}

body .domig-handler-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(31, 42, 46, 0.09);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.04);
}

body .domig-entity-card-head,
body .domig-context-card-head,
body .domig-inline-note-head,
body .domig-procedure-runner-head,
body .domig-procedure-builder-head,
body .domig-procedure-builder-toolbar,
body .domig-procedure-builder-row,
body .domig-procedure-settings-item,
body .domig-procedure-builder-panel .domig-context-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

body .domig-entity-card-head h4,
body .domig-entity-card-head p,
body .domig-context-card-head strong,
body .domig-context-card-head span,
body .domig-inline-note-head strong,
body .domig-inline-note-head span,
body .domig-procedure-builder-head h3,
body .domig-procedure-builder-head p {
  margin: 0;
}

body .domig-entity-card-head p,
body .domig-context-card-head span,
body .domig-inline-note-head span,
body .domig-procedure-runner-head span,
body .domig-procedure-builder-head p,
body .domig-procedure-builder-toolbar span,
body .domig-procedure-settings-item p,
body .domig-procedure-settings-stat span {
  color: #657474;
  font-size: 13px;
  line-height: 1.45;
}

body .domig-entity-card--compact {
  gap: 12px;
}

body .domig-entity-inline-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

body .domig-entity-inline-line--header {
  align-items: center;
  flex-wrap: nowrap;
}

body .domig-entity-inline-line--secondary {
  align-items: center;
}

body .domig-entity-inline-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
  flex: 1 1 auto;
}

body .domig-entity-inline-copy h4,
body .domig-entity-inline-secondary-copy {
  margin: 0;
}

body .domig-entity-inline-secondary-copy {
  color: #4d5b5c;
  font-size: 14px;
  line-height: 1.45;
}

body .domig-entity-inline-person-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

body .domig-entity-inline-person-name {
  min-width: 0;
}

body .domig-entity-inline-secondary-copy strong {
  color: #1f2a2e;
  font-weight: 700;
}

body .domig-entity-inline-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

body .domig-entity-inline-meta--row {
  width: 100%;
  margin-left: 0;
  justify-content: space-between;
}

body .domig-entity-inline-pills {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

body .domig-entity-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #9e9e9e;
  color: #111111;
  font-size: 12px;
  font-family: inherit;
  font-weight: 700;
  line-height: 1;
}

body button.domig-entity-pill {
  cursor: pointer;
}

body .domig-entity-pill--neutral {
  background: #e8e8e8;
  color: #111111;
}

body .domig-entity-pill--warning {
  background: #ffecc7;
  color: #111111;
}

body .domig-entity-pill--success {
  background: #dbf6e4;
  color: #111111;
}

body .domig-entity-pill--danger {
  background: #ffd6c7;
  color: #111111;
}

body .domig-entity-pill--accent {
  background: #e8e8e8;
  color: #111111;
}

body .domig-entity-pill--sky {
  background: #dbe6ff;
  color: #111111;
}

body .domig-entity-pill--copy {
  border-color: transparent;
  background: #e8e8e8;
  color: #111111;
}

body .domig-entity-pill--copy:hover,
body .domig-entity-pill--copy:focus-visible {
  outline: none;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

body .domig-entity-callout-name {
  color: #2f7d32;
  font-weight: 800;
}

body .domig-entity-card-tools,
body .domig-procedure-builder-stack,
body .domig-procedure-settings-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

body .domig-procedure-builder-stack {
  flex-wrap: wrap;
}

body .domig-procedure-builder-stack--inline {
  align-items: center;
}

body .domig-entity-card-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

body .domig-entity-card-badges span,
body .domig-procedure-node-type,
body .domig-procedure-builder-procedure span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(31, 42, 46, 0.08);
  color: #556465;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body .domig-info-button {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #e8e8e8;
  color: #111111;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

body .domig-info-button:hover,
body .domig-info-button:focus-visible,
body .domig-procedure-search-item:hover,
body .domig-procedure-search-item:focus-visible,
body .domig-procedure-search-favorite:hover,
body .domig-procedure-search-favorite:focus-visible,
body .domig-procedure-tab:hover,
body .domig-procedure-tab:focus-visible,
body .domig-procedure-tab-close:hover,
body .domig-procedure-tab-close:focus-visible,
body .domig-procedure-node:hover,
body .domig-procedure-node:focus-visible,
body .domig-procedure-builder-procedure:hover,
body .domig-procedure-builder-procedure:focus-visible {
  outline: none;
  border-color: rgba(46, 94, 91, 0.28);
  box-shadow: 0 10px 24px rgba(46, 94, 91, 0.1);
}

body .domig-info-button:hover,
body .domig-info-button:focus-visible {
  border-color: transparent;
}

body .domig-entity-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body .domig-entity-card-item,
body .domig-context-card-item,
body .domig-procedure-settings-stat {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f6faf8;
  border: 1px solid rgba(31, 42, 46, 0.08);
}

body .domig-entity-card-item span,
body .domig-context-card-item span {
  color: #617172;
  font-size: 12px;
}

body .domig-entity-card-item strong,
body .domig-context-card-item strong,
body .domig-procedure-settings-stat strong,
body .domig-procedure-builder-procedure strong,
body .domig-procedure-runner-head strong,
body .domig-procedure-node strong,
body .domig-procedure-builder-head h3 {
  color: #1f2a2e;
}

body .domig-entity-note-inline {
  display: grid;
  gap: 6px;
}

body .domig-entity-note-inline > span {
  color: #657474;
  font-size: 11px;
  font-weight: 700;
}

body .domig-entity-note-card textarea,
body .domig-procedure-builder-panel textarea,
body .domig-procedure-builder-panel input,
body .domig-procedure-builder-panel select,
body .domig-procedure-search-field input,
body .domig-procedure-field input,
body .domig-procedure-field textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(31, 42, 46, 0.13);
  background: #ffffff;
}

body .domig-procedure-search-field input {
  min-height: 48px;
  padding: 12px 14px;
}

body .domig-entity-note-card textarea,
body .domig-procedure-builder-panel textarea {
  min-height: 92px;
  resize: vertical;
}

body .domig-entity-note-card {
  display: grid;
  gap: 12px;
}

body .domig-entity-note-card:not(.is-editing) .domig-inline-note-actions {
  display: none;
}

body .domig-entity-note-card:not(.is-editing) textarea {
  min-height: 48px;
  max-height: 48px;
  overflow: hidden;
  resize: none;
}

body .domig-entity-note-card.is-editing textarea {
  min-height: 110px;
  max-height: 240px;
  overflow: auto;
}

body .domig-inline-note-actions,
body .domig-procedure-runner-actions,
body .domig-procedure-history,
body .domig-procedure-choice-list,
body .domig-procedure-tabs,
body .domig-procedure-settings-overview,
body .domig-procedure-builder-inline-grid,
body .domig-procedure-builder-sublist,
body .domig-procedure-builder-procedure-list {
  display: flex;
  gap: 10px;
}

body .domig-inline-note-actions,
body .domig-procedure-runner-actions,
body .domig-procedure-choice-list,
body .domig-procedure-tabs,
body .domig-procedure-settings-overview,
body .domig-procedure-builder-sublist,
body .domig-procedure-builder-procedure-list {
  flex-wrap: wrap;
}

body .domig-inline-note-actions {
  align-items: center;
  justify-content: space-between;
}

body .domig-inline-note-buttons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

body .domig-inline-note-actions span {
  color: #6c7a79;
  font-size: 12px;
}

body .domig-context-card-list {
  display: grid;
  gap: 10px;
}

body .domig-context-card-item small {
  color: #778586;
  font-size: 12px;
}

body .domig-context-card-item--event {
  padding: 0;
  overflow: hidden;
}

body .domig-context-card-item--event.is-expanded {
  background: #eef7f2;
}

body .domig-context-event-toggle {
  width: 100%;
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

body .domig-context-event-toggle:hover,
body .domig-context-event-toggle:focus-visible {
  background: rgba(31, 42, 46, 0.03);
  outline: none;
}

body .domig-context-event-details {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
  border-top: 1px solid rgba(31, 42, 46, 0.08);
}

body .domig-context-event-detail-list {
  display: grid;
  gap: 8px;
}

body .domig-context-event-detail-row {
  display: grid;
  gap: 4px;
}

body .domig-context-event-detail-row strong {
  font-size: 13px;
  line-height: 1.5;
}

body .domig-context-event-detail-text {
  margin: 0;
  color: #4f6161;
  font-size: 13px;
  line-height: 1.5;
}

body .domig-context-card-empty,
body .domig-procedure-empty-card,
body .domig-procedure-search-empty,
body .domig-procedure-runner--empty,
body .domig-procedure-builder-empty {
  padding: 14px 16px;
  border: 1px dashed rgba(31, 42, 46, 0.16);
  border-radius: 14px;
  background: #fafcfb;
  color: #667576;
}

body .domig-procedure-search-block,
body .domig-procedure-runner,
body .domig-procedure-builder-panel,
body .domig-procedure-settings-list {
  display: grid;
  gap: 12px;
}

body .domig-handler-card--procedures,
body .domig-procedure-search-block {
  overflow: visible;
}

body .domig-procedure-search-field,
body .domig-procedure-builder-panel label,
body .domig-procedure-field {
  display: grid;
  gap: 8px;
}

body .domig-procedure-search-field span,
body .domig-procedure-builder-panel label span,
body .domig-procedure-field span {
  color: #445255;
  font-size: 12px;
  font-weight: 700;
}

body .domig-procedure-search-results,
body .domig-procedure-builder-procedure-list {
  display: grid;
  gap: 8px;
}

body .domig-procedure-search-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

body .domig-procedure-builder-procedure-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

body .domig-procedure-search-block {
  position: relative;
}

body .domig-procedure-search-block:not(.is-open) .domig-procedure-search-results {
  display: none;
}

body .domig-procedure-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 22;
  max-height: 320px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(31, 42, 46, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(10, 20, 24, 0.12);
}

body .domig-procedure-search-item,
body .domig-procedure-builder-procedure,
body .domig-procedure-choice,
body .domig-procedure-node,
body .domig-procedure-tab,
body .domig-procedure-tab-close {
  border: 1px solid rgba(31, 42, 46, 0.12);
  background: #ffffff;
  color: #1f2a2e;
}

body .domig-procedure-search-item,
body .domig-procedure-builder-procedure,
body .domig-procedure-choice,
body .domig-procedure-tab,
body .domig-procedure-node {
  cursor: pointer;
}

body .domig-procedure-search-item,
body .domig-procedure-builder-procedure {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  text-align: left;
}

body .domig-procedure-builder-procedure-edit {
  min-width: 44px;
  border: 1px solid rgba(31, 42, 46, 0.12);
  border-radius: 14px;
  background: #ffffff;
  color: #1f2a2e;
  font-size: 16px;
  cursor: pointer;
}

body .domig-procedure-builder-procedure-edit.is-active {
  border-color: rgba(31, 107, 102, 0.34);
  box-shadow: 0 10px 22px rgba(31, 107, 102, 0.12);
}

body .domig-procedure-search-favorite {
  min-width: 44px;
  border: 1px solid rgba(31, 42, 46, 0.12);
  border-radius: 14px;
  background: #ffffff;
  color: #7a8889;
  font-size: 18px;
  cursor: pointer;
}

body .domig-procedure-search-favorite.is-active {
  border-color: rgba(217, 74, 91, 0.24);
  background: rgba(217, 74, 91, 0.08);
  color: #d94a5b;
}

body .domig-procedure-search-item span {
  color: #697777;
  font-size: 13px;
}

body .domig-procedure-tab-shell {
  position: relative;
}

body .domig-procedure-tab {
  min-width: 156px;
  max-width: 220px;
  display: grid;
  gap: 4px;
  padding: 12px 38px 12px 14px;
  border-radius: 14px;
  text-align: left;
}

body .domig-procedure-tab.is-active,
body .domig-procedure-builder-procedure.is-active,
body .domig-procedure-node.is-selected {
  background: linear-gradient(135deg, #edf9f1 0%, #fbfffd 100%);
  border-color: rgba(46, 94, 91, 0.28);
}

body .domig-procedure-tab span {
  color: #667474;
  font-size: 12px;
}

body .domig-procedure-tab-close {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  cursor: pointer;
}

body .domig-procedure-node-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(31, 42, 46, 0.1);
  background: #ffffff;
}

body .domig-procedure-node-card h4,
body .domig-procedure-node-card p {
  margin: 0;
}

body .domig-procedure-node-card p,
body .domig-procedure-history span,
body .domig-procedure-template-preview {
  color: #4b595a;
  line-height: 1.5;
}

body .domig-procedure-form-grid {
  display: grid;
  gap: 12px;
}

body .domig-procedure-choice {
  padding: 10px 14px;
  border-radius: 12px;
}

body .domig-procedure-template-preview {
  padding: 12px 14px;
  border-radius: 14px;
  background: #f5f8f7;
  white-space: pre-wrap;
}

body .domig-procedure-history span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31, 42, 46, 0.07);
  font-size: 12px;
}

body .domig-procedure-settings-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body .domig-procedure-settings-item {
  padding: 16px 18px;
  border: 1px solid rgba(31, 42, 46, 0.09);
  border-radius: 16px;
  background: #ffffff;
}

body .domig-procedure-builder-page {
  display: grid;
  gap: 20px;
}

body.procedure-builder-standalone-page {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(192, 230, 210, 0.55), transparent 34%),
    linear-gradient(180deg, #f2f8f4 0%, #f8fbf9 42%, #ffffff 100%);
}

body .procedure-builder-standalone-shell {
  width: min(1840px, 100%);
  margin: 0 auto;
  padding: 24px;
  box-sizing: border-box;
}

body .domig-procedure-builder-page-shell {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(31, 42, 46, 0.09);
  background: linear-gradient(180deg, #f8fcfa 0%, #ffffff 100%);
  box-shadow: 0 24px 52px rgba(10, 20, 24, 0.08);
  min-height: calc(100vh - 172px);
  overflow: hidden;
}

body .domig-procedure-builder-page-shell .domig-procedure-builder-layout {
  min-height: calc(100vh - 208px);
  height: auto;
}

body .domig-procedure-builder-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

body .domig-procedure-builder-modal.hidden {
  display: none;
}

body .domig-procedure-builder-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 23, 28, 0.58);
  backdrop-filter: blur(6px);
}

body .domig-procedure-builder-window {
  position: relative;
  z-index: 1;
  width: min(96vw, 1600px);
  height: min(94vh, 980px);
  margin: 3vh auto;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, #f8fcfa 0%, #ffffff 100%);
  box-shadow: 0 32px 80px rgba(10, 20, 24, 0.28);
  overflow: hidden;
}

body .domig-procedure-builder-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 360px;
  gap: 18px;
  height: 100%;
}

body .domig-procedure-builder-page-shell.is-sidebar-collapsed .domig-procedure-builder-layout {
  grid-template-columns: 0 minmax(0, 1fr) 360px;
}

body .domig-procedure-builder-sidebar,
body .domig-procedure-builder-inspector,
body .domig-procedure-builder-canvas-wrap {
  min-height: 0;
}

body .domig-procedure-builder-sidebar,
body .domig-procedure-builder-inspector {
  display: grid;
  gap: 14px;
  align-content: start;
  overflow: auto;
}

body .domig-procedure-builder-sidebar.is-collapsed {
  gap: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

body .domig-procedure-builder-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body .domig-procedure-builder-canvas-wrap {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}

body .domig-procedure-builder-toolbar {
  align-items: center;
  flex-wrap: nowrap;
  overflow: visible;
}

body .domig-procedure-builder-toolbar-line {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: visible;
}

body .domig-procedure-builder-toolbar-picker {
  position: relative;
  min-width: 0;
  flex: 1 1 240px;
}

body .domig-procedure-builder-toolbar-picker input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(31, 42, 46, 0.12);
  border-radius: 14px;
  background: #f8fcfa;
  color: #1f2a2e;
  font: inherit;
}

body textarea#procedureBuilderTagsInput {
  min-height: 72px;
  resize: none;
  overflow: hidden;
}

body .domig-procedure-builder-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 6;
  display: grid;
  gap: 6px;
  max-height: 320px;
  padding: 8px;
  border: 1px solid rgba(31, 42, 46, 0.12);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.14);
  overflow: auto;
}

body .domig-procedure-builder-picker-menu[hidden] {
  display: none;
}

body .domig-procedure-builder-picker-option {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  color: #1f2a2e;
  font: inherit;
}

body .domig-procedure-builder-picker-option:hover,
body .domig-procedure-builder-picker-option:focus-visible {
  background: #eef6f2;
  outline: none;
}

body .domig-procedure-builder-picker-option.is-selected {
  background: #e4f3ec;
  box-shadow: inset 0 0 0 1px rgba(46, 94, 91, 0.2);
}

body .domig-procedure-builder-picker-option[hidden] {
  display: none;
}

body .domig-procedure-builder-picker-option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  color: #526264;
  font-size: 16px;
}

body .domig-procedure-builder-picker-option-text {
  display: grid;
  gap: 4px;
}

body .domig-procedure-builder-picker-option-text strong,
body .domig-procedure-builder-picker-option-text small {
  margin: 0;
}

body .domig-procedure-builder-picker-option-text small {
  color: #657474;
  line-height: 1.4;
}

body .domig-procedure-builder-icon-btn {
  box-shadow: none;
}

body .domig-procedure-builder-toolbar-divider {
  flex: 0 0 1px;
  width: 1px;
  height: 28px;
  background: rgba(31, 42, 46, 0.12);
}

body .domig-procedure-builder-zoom-btn {
  min-width: 78px;
}

body .domig-procedure-builder-toolbar-save {
  margin-left: auto;
}

body .domig-procedure-builder-sidebar-expand-btn {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 2;
}

body .domig-procedure-builder-toolbar,
body .domig-procedure-builder-panel {
  padding: 14px;
  border: 1px solid rgba(31, 42, 46, 0.09);
  border-radius: 16px;
  background: #ffffff;
}

body .domig-procedure-builder-canvas-shell {
  position: relative;
  min-height: 0;
  min-height: 620px;
  border: 1px solid rgba(31, 42, 46, 0.1);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(46, 94, 91, 0.08), transparent 28%),
    linear-gradient(0deg, rgba(31, 42, 46, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 42, 46, 0.03) 1px, transparent 1px),
    #fcfefd;
  background-size: auto, 28px 28px, 28px 28px, auto;
  overflow: hidden;
  cursor: grab;
}

body .domig-procedure-builder-canvas-shell.is-panning {
  cursor: grabbing;
}

body .domig-procedure-builder-canvas-pan {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}

body .domig-procedure-builder-canvas-scale {
  position: absolute;
  left: 0;
  top: 0;
  width: 1200px;
  height: 900px;
  transform-origin: 0 0;
}

body .domig-procedure-builder-canvas,
body .domig-procedure-builder-canvas-svg {
  position: absolute;
  inset: 0;
  width: 1200px;
  height: 900px;
}

body .domig-procedure-builder-canvas-svg {
  pointer-events: none;
}

body .domig-procedure-builder-canvas-svg path {
  fill: none;
  stroke: rgba(46, 94, 91, 0.5);
  stroke-width: 2;
}

body .domig-procedure-builder-canvas-svg text {
  fill: #526264;
  font-size: 12px;
}

body .domig-procedure-node {
  position: absolute;
  width: 216px;
  display: grid;
  gap: 8px;
  padding: 14px 42px 14px 14px;
  border-radius: 16px;
  text-align: left;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.06);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

body .domig-procedure-node-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(31, 42, 46, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #6a7778;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

body .domig-procedure-node:hover .domig-procedure-node-delete,
body .domig-procedure-node:focus-within .domig-procedure-node-delete {
  opacity: 1;
  pointer-events: auto;
}

body .domig-procedure-node-delete:hover,
body .domig-procedure-node-delete:focus-visible {
  background: #fff0ec;
  border-color: rgba(185, 78, 58, 0.24);
  color: #b94e3a;
  outline: none;
  transform: translateY(-1px);
}

body .domig-procedure-node-delete:disabled {
  opacity: 0.35;
  pointer-events: none;
}

body .domig-procedure-node.is-dragging {
  cursor: grabbing;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

body .domig-procedure-node small {
  color: #677676;
  font-size: 12px;
  line-height: 1.45;
}

body .domig-procedure-builder-inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body .domig-procedure-builder-inline-grid--procedure {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body .domig-procedure-builder-sublist {
  display: grid;
}

body .domig-procedure-builder-row {
  align-items: center;
}

body .domig-procedure-builder-row--field {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 160px minmax(0, 1fr) auto auto;
  gap: 10px;
}

body .domig-procedure-builder-row input,
body .domig-procedure-builder-row select {
  flex: 1 1 0;
}

body .domig-procedure-builder-row .btn {
  flex: 0 0 auto;
}

body .domig-procedure-builder-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #445255;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

body .domig-procedure-builder-check input {
  flex: 0 0 auto;
}

body .domig-procedure-builder-token-editor {
  display: grid;
  gap: 10px;
}

body .domig-procedure-builder-token-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

body .domig-procedure-builder-token-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body .domig-procedure-builder-token {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(31, 42, 46, 0.12);
  border-radius: 999px;
  background: #f6fbf8;
  color: #1f2a2e;
  font: inherit;
  font-size: 13px;
}

body .domig-procedure-builder-token:hover,
body .domig-procedure-builder-token:focus-visible {
  border-color: rgba(46, 94, 91, 0.28);
  background: #eef6f2;
  outline: none;
}

body .domig-procedure-builder-token-empty {
  color: #657474;
  font-size: 12px;
  line-height: 1.45;
}

body .domig-procedure-builder-preview {
  display: grid;
  gap: 12px;
}

body .domig-procedure-builder-preview-card,
body .domig-procedure-builder-preview--technical,
body .domig-procedure-builder-preview--empty {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(31, 42, 46, 0.1);
  border-radius: 18px;
  background: linear-gradient(180deg, #f6fbf8 0%, #ffffff 100%);
}

body .domig-procedure-builder-preview-kicker {
  color: #526264;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body .domig-procedure-builder-preview h4,
body .domig-procedure-builder-preview p {
  margin: 0;
}

body .domig-procedure-builder-preview p {
  color: #5d6c6d;
  line-height: 1.55;
}

body .domig-procedure-builder-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body .domig-procedure-builder-preview-btn {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(31, 42, 46, 0.12);
  border-radius: 14px;
  background: #ffffff;
  color: #1f2a2e;
  font: inherit;
  font-weight: 700;
}

body .domig-procedure-builder-preview-btn.is-primary {
  background: #ecf7f2;
  border-color: rgba(46, 94, 91, 0.2);
}

body .domig-procedure-builder-preview-fields {
  display: grid;
  gap: 12px;
}

body .domig-procedure-builder-preview-field {
  display: grid;
  gap: 6px;
}

body .domig-procedure-builder-preview-input {
  min-height: 42px;
  padding: 11px 12px;
  border: 1px solid rgba(31, 42, 46, 0.12);
  border-radius: 12px;
  background: #ffffff;
  color: #7a8789;
}

body .domig-procedure-builder-preview-input--multiline {
  min-height: 88px;
}

body .domig-procedure-builder-preview--technical {
  background: linear-gradient(180deg, #f7f8f8 0%, #ffffff 100%);
}

body .domig-procedure-builder-panel textarea#procedureBuilderJsonInput {
  min-height: 220px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12px;
}

body.domig-procedure-builder-open {
  overflow: hidden;
}

@media (max-width: 980px) {
  body .operator-task-tab {
    min-width: 200px;
    max-width: 240px;
  }

  body .operator-note-editor-actions {
    flex-direction: column;
  }

  body .domig-entity-card-grid,
  body .domig-procedure-settings-overview,
  body .domig-procedure-builder-inline-grid {
    grid-template-columns: 1fr;
  }

  body .domig-procedure-builder-inline-grid--procedure,
  body .domig-procedure-builder-row--field {
    grid-template-columns: 1fr;
  }

  body .domig-procedure-builder-window {
    width: calc(100vw - 12px);
    height: calc(100vh - 12px);
    margin: 6px;
    padding: 14px;
  }

  body .domig-procedure-builder-page-shell {
    padding: 14px;
    min-height: 0;
  }

  body .domig-entity-inline-line--header {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  body .procedure-builder-standalone-shell {
    padding: 16px;
  }

  body .domig-procedure-builder-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(320px, 1fr);
    height: calc(100% - 64px);
    overflow: auto;
  }

  body .domig-procedure-builder-page-shell.is-sidebar-collapsed .domig-procedure-builder-layout {
    grid-template-columns: 1fr;
  }

  body .domig-procedure-builder-sidebar,
  body .domig-procedure-builder-inspector {
    overflow: visible;
  }

  body .domig-procedure-builder-sidebar.is-collapsed {
    display: none;
  }

  body .domig-procedure-builder-toolbar {
    overflow: visible;
  }

  body .domig-procedure-builder-toolbar-line {
    flex-wrap: wrap;
    overflow: visible;
  }

  body .domig-procedure-builder-token-controls {
    grid-template-columns: 1fr;
  }

  body .domig-procedure-builder-sidebar-expand-btn {
    position: static;
  }
}

/* Карточки */
.card {
  background-color: var(--color-white);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--shadow) 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.card-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.card-body {
  padding: 0;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

/* Входные поля */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: 14px;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='tel'],
input[type='date'],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  background-color: var(--color-white);
  color: var(--color-text-primary);
  transition: var(--transition);
  font-family: inherit;
}

input[type='text']:focus,
input[type='email']:focus,
input[type='password']:focus,
input[type='number']:focus,
input[type='tel']:focus,
input[type='date']:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 164, 0.1);
}

input[type='checkbox'],
input[type='radio'] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* Переключатель (Toggle) */
.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-switch {
  position: relative;
  width: 56px;
  height: 32px;
  background-color: var(--color-border);
  border-radius: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-switch.active {
  background-color: var(--color-primary);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  background-color: var(--color-white);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: var(--transition);
}

.toggle-switch.active::after {
  left: 26px;
}

.form-group.toggle-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-group.toggle-group label {
  margin-bottom: 0;
}

.form-group.toggle-group .toggle-switch {
  margin: 0;
}

/* Иконки-кнопки */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-bg-secondary);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  color: var(--color-text-primary);
  font-size: 20px;
}

.icon-btn:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 2px 8px rgba(74, 144, 164, 0.3);
}

/* Бейджи */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-primary {
  background-color: rgba(74, 144, 164, 0.1);
  color: var(--color-primary);
}

.badge-success {
  background-color: rgba(107, 184, 150, 0.1);
  color: var(--color-success);
}

.badge-warning {
  background-color: rgba(232, 167, 93, 0.1);
  color: var(--color-warning);
}

.badge-danger {
  background-color: rgba(217, 126, 121, 0.1);
  color: var(--color-danger);
}

/* Таблицы */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background-color: var(--color-bg-secondary);
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: var(--color-text-primary);
  border-bottom: 2px solid var(--color-border);
  font-size: 14px;
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
}

tr:hover td {
  background-color: var(--color-bg-secondary);
}

/* Модальные окна */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.modal.active {
  display: flex;
}

.modal.hidden {
  display: none;
}


.modal-content {
  background-color: var(--color-white);
  border-radius: var(--border-radius-lg);
  padding: 32px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--color-text-primary);
}

/* Большие модальные окна */
.modal-large .modal-content {
  max-width: 800px;
}

/* Модальное окно с боковой панелью */
.modal-with-sidebar {
  display: flex;
  padding: 0 !important;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  max-width: 700px;
  max-height: 600px;
}

.modal-sidebar {
  width: 200px;
  background-color: var(--color-bg-secondary);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.modal-close {
  align-self: flex-end;
  margin-bottom: 16px;
}

.modal-sidebar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.sidebar-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: 14px;
  border-radius: 6px;
  transition: var(--transition);
  margin-bottom: 8px;
}

.sidebar-item:hover {
  background-color: rgba(74, 144, 164, 0.1);
  color: var(--color-primary);
}

.sidebar-item.active {
  background-color: var(--color-primary);
  color: var(--color-white);
  font-weight: 600;
}

.modal-main {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

/* Профиль и настройки */
.profile-header, .settings-header {
  margin-bottom: 24px;
}

.profile-header h2, .settings-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
}

.profile-info-group,
.settings-section-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.info-item label {
  font-weight: 600;
  color: var(--color-text-secondary);
}

.info-item span {
  color: var(--color-text-primary);
  font-weight: 500;
}

.setting-item {
  padding: 16px;
  background-color: var(--color-bg-secondary);
  border-radius: var(--border-radius);
}

.setting-label {
  display: block;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--color-text-primary);
}

.setting-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.checkbox-label, .radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input, .radio-label input {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.checkbox-label span, .radio-label span {
  font-size: 14px;
  color: var(--color-text-primary);
}

/* Оповещения */
.alert {
  padding: 16px;
  border-radius: var(--border-radius);
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.alert-success {
  background-color: rgba(107, 184, 150, 0.1);
  color: #3a7a5e;
  border-left: 4px solid var(--color-success);
}

.alert-warning {
  background-color: rgba(232, 167, 93, 0.1);
  color: #8b6a3a;
  border-left: 4px solid var(--color-warning);
}

.alert-danger {
  background-color: rgba(217, 126, 121, 0.1);
  color: #8b4a47;
  border-left: 4px solid var(--color-danger);
}

.alert-info {
  background-color: rgba(74, 144, 164, 0.1);
  color: #2d5a6f;
  border-left: 4px solid var(--color-primary);
}

.alert-close {
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
  color: inherit;
}

/* Спиннер загрузки */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(74, 144, 164, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Состояние загрузки */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  color: var(--color-text-secondary);
  padding: 40px;
}

/* Пустое состояние */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-secondary);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-state-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text-primary);
}

.empty-state-text {
  font-size: 14px;
  margin-bottom: 24px;
}

/* Компоновка */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-sm {
  max-width: 500px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-lg {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-full {
  width: 100%;
  padding: 0 20px;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.flex {
  display: flex;
  gap: 12px;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.flex-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flex-wrap {
  flex-wrap: wrap;
}

/* Пространство */
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.pt-8 { padding-top: 8px; }
.pt-16 { padding-top: 16px; }
.pt-24 { padding-top: 24px; }

.pb-8 { padding-bottom: 8px; }
.pb-16 { padding-bottom: 16px; }
.pb-24 { padding-bottom: 24px; }

/* Текст */
.text-center { text-align: center; }
.text-right { text-align: right; }

.text-sm { font-size: 12px; }
.text-base { font-size: 16px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 24px; }

.text-muted { color: var(--color-text-secondary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-normal { font-weight: 400; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* ============================================================================
   Адаптивность
   ============================================================================ */

@media (max-width: 768px) {
  .container,
  .container-sm,
  .container-lg {
    padding: 0 16px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .card {
    padding: 16px;
  }

  .modal-content {
    padding: 24px;
    width: 95%;
  }

  table {
    font-size: 14px;
  }

  th,
  td {
    padding: 8px;
  }

  .card-title {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .container,
  .container-sm,
  .container-lg {
    padding: 0 12px;
  }

  .btn {
    padding: 8px 16px;
    font-size: 13px;
  }

  .card {
    padding: 12px;
  }

  .card-title {
    font-size: 16px;
  }

  .modal-content {
    padding: 16px;
    width: 98%;
  }

  input[type='text'],
  input[type='email'],
  input[type='password'],
  input[type='number'],
  input[type='tel'],
  input[type='date'],
  select,
  textarea {
    padding: 10px 12px;
    font-size: 14px;
  }
}
