@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg-space: #070a13;
  --bg-surface: #0e1526;
  --bg-card: rgba(18, 26, 45, 0.75);
  --bg-card-hover: rgba(24, 35, 60, 0.9);
  --bg-input: #0a0f1d;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.4);
  
  --accent-cyan: #06b6d4;
  --accent-indigo: #6366f1;
  --accent-purple: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #6366f1 50%, #a855f7 100%);
  --accent-gradient-text: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);

  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.12);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.12);
  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.12);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-glow: 0 10px 30px -10px rgba(99, 102, 241, 0.35);
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: #070a13;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  background-image: linear-gradient(180deg, #070a13 0%, #0d1322 100%);
  overflow-x: hidden;
}

/* Верхняя полоса навигации */
.header-bar {
  border-bottom: 1px solid var(--border-subtle);
  background: #0d1322;
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.75rem 1.5rem;
}

.header-inner {
  max-width: 96%; width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.3rem;
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.logo-title {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.logo-subtitle {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  font-weight: 700;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.support-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.support-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Главный контейнер */
.hero-wrapper {
  max-width: 96%; width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.hero-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 2.5rem;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #38bdf8;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-gradient-text {
  background: var(--accent-gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Поисковая карточка */
.search-box-card {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  max-width: 820px;
  margin: 0 auto 3rem;
  position: relative;
}

.search-input-row {
  display: flex;
  gap: 0.75rem;
}

.search-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.03em;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.25);
  background: #0d1424;
}

.search-input::placeholder {
  font-family: var(--font-sans);
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 400;
}

.btn-search {
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-md);
  padding: 0 2rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-glow);
}

.btn-search:hover {
  opacity: 0.92;
  transform: translateY(-2px);
}

.quick-examples {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.chip-example {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #a5b4fc;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-example:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
}

/* Состояния: Загрузка и Ошибка */
.status-state-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Сетка результатов */
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 992px) {
  .result-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 2.1rem;
  }
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.info-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-3px);
}

.card-top-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.card-accent-license { background: linear-gradient(90deg, #10b981, #06b6d4); }
.card-accent-software { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.card-accent-hardware { background: linear-gradient(90deg, #f59e0b, #ec4899); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.detail-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  flex: 1;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.detail-value {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

/* Моноширинный бейдж ключа */
.key-highlight-badge {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #38bdf8;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  user-select: all;
  white-space: nowrap;
}

.btn-mini-copy {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
}

.btn-mini-copy:hover {
  background: var(--accent-cyan);
  color: #000;
  font-weight: 700;
}

/* Статус-бейдж */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
}

.status-pill.badge-active {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.badge-suspended {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pill.badge-revoked, .status-pill.badge-expired {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

.offline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-warning);
}

/* Блок привязанных устройств и рабочих станций */
.device-card-item {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 0.75rem;
}

.device-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.device-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.device-zn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #38bdf8;
}

.device-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

/* Действия клиента внизу карточки */
.client-actions-bar {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 0.75rem;
}

.btn-client-action {
  flex: 1;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-client-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-client-action.primary {
  background: rgba(6, 182, 212, 0.18);
  border-color: rgba(6, 182, 212, 0.4);
  color: #38bdf8;
}

.btn-client-action.primary:hover {
  background: var(--accent-cyan);
  color: #000;
}

/* Подвал */
.site-footer {
  text-align: center;
  padding: 2.5rem 1rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ================== СТИЛИ АВТОРИЗАЦИИ И ЛИЧНОГО КАБИНЕТА ================== */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2.5rem 1rem 4rem;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: #0e1526;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-icon-badge {
  width: 52px;
  height: 52px;
  margin: 0 auto 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  line-height: 1.45;
}

.auth-tabs {
  display: flex;
  background: rgba(10, 15, 29, 0.65);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.35rem;
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  padding: 0.6rem 0.5rem;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn.active {
  background: rgba(99, 102, 241, 0.25);
  color: #fff;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.auth-alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  text-align: center;
}

.auth-form .form-group {
  margin-bottom: 1.15rem;
}

.auth-form .form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.auth-input {
  width: 100%;
  padding: 0.75rem 0.95rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.92rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

.btn-auth-submit {
  width: 100%;
  padding: 0.85rem;
  margin-top: 0.5rem;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.25);
}

.btn-auth-submit:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0 1rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.auth-divider span {
  padding: 0 0.75rem;
}

.btn-demo-quick {
  width: 100%;
  padding: 0.7rem;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-sm);
  color: #38bdf8;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-demo-quick:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.5);
}

/* Элементы шапки пользователя */
.user-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  color: #38bdf8;
  font-weight: 600;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* БЛОК ЗАЩИТНОЙ МАСКИ КЛЮЧА */
.key-mask-container {
  background: rgba(10, 15, 29, 0.85);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  margin-top: 0.75rem;
}

.key-mask-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.key-mask-box {
  background: rgba(0, 0, 0, 0.35);
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  text-align: center;
  margin-bottom: 0.65rem;
}

.key-display-text {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #34d399;
}

.key-display-text.unmasked {
  color: #38bdf8;
}

.key-mask-controls {
  display: flex;
  gap: 0.5rem;
}

.btn-key-action {
  flex: 1;
  padding: 0.45rem 0.65rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-key-action:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}

/* ================== СТИЛИ ЕДИНОЙ КАРТОЧКИ МОНИТОРИНГА ================== */
.cabinet-top-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.id-switch-panel {
  display: flex;
  gap: 0.5rem;
  background: rgba(18, 26, 45, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.switch-id-input {
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: 6px;
  color: #fff;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-family: inherit;
  min-width: 220px;
}

.switch-id-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.btn-switch-id {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #38bdf8;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.5rem 0.95rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-switch-id:hover {
  background: var(--accent-cyan);
  color: #000;
}

.user-dot-online {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 8px #10b981;
}

.status-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid #f87171;
  color: #f87171;
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

/* ================== КОМПАКТНЫЕ КАРТОЧКИ ПРИЛОЖЕНИЙ (ВЫСОКАЯ ПЛОТНОСТЬ И 60+ FPS) ================== */
.compact-cards-grid,
#compact-licenses-container {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 1rem !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: 100% !important;
  margin-bottom: 2rem !important;
}

.compact-license-card {
  background: #0e1526;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.compact-license-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.compact-license-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
}

.compact-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.compact-app-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.compact-app-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.compact-app-title-group {
  min-width: 0;
}

.compact-app-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-app-ver {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.compact-badges-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.compact-key-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #070a13;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  gap: 0.5rem;
}

.compact-key-code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #34d399;
}

.compact-key-code.unmasked {
  color: #38bdf8;
}

.compact-key-actions {
  display: flex;
  gap: 0.4rem;
}

.compact-btn {
  padding: 3px 8px;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.compact-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.compact-grid-data {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.85rem;
  background: rgba(7, 10, 19, 0.4);
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.compact-data-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.compact-data-lbl {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.compact-data-val {
  font-size: 0.82rem;
  color: #f1f5f9;
  font-weight: 600;
  line-height: 1.3;
}

.compact-card-bot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.74rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ================== APPLICATION MONITORING & REMOTE CONTROL ================== */
.mon-app-details-box {
  margin-top: 0.65rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mon-app-details-box.empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.3);
}

.mon-app-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.45rem;
}

.mon-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

.mon-status-indicator.online {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.mon-status-indicator.offline {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.mon-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.mon-status-indicator.online .mon-status-dot {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.mon-status-indicator.offline .mon-status-dot {
  background: #64748b;
}

@keyframes monPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.mon-app-ver-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.mon-app-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.75rem;
  font-size: 0.78rem;
}

.mon-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mon-meta-lbl {
  font-size: 0.67rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.mon-meta-val {
  color: #e2e8f0;
  font-weight: 600;
}

.mon-svc-container {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.mon-svc-header {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.mon-svc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mon-svc-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
}

.mon-svc-tag.svc-ok {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.mon-svc-tag.svc-fail {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  text-decoration: none;
}

.mon-pending-alert {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
}

.mon-pending-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(251, 191, 36, 0.3);
  border-top-color: #fbbf24;
  border-radius: 50%;
  animation: monSpin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes monSpin {
  to { transform: rotate(360deg); }
}

.mon-ctrl-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.mon-action-btn {
  font-family: inherit;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  border: 1px solid transparent;
  background: rgba(30, 41, 59, 0.8);
  color: #f8fafc;
}

.mon-action-btn.btn-start {
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.1);
}
.mon-action-btn.btn-start:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
}

.mon-action-btn.btn-restart {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
}
.mon-action-btn.btn-restart:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
}

.mon-action-btn.btn-stop {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
}
.mon-action-btn.btn-stop:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
}

.mon-action-btn.btn-app-restart {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.1);
}
.mon-action-btn.btn-app-restart:hover {
  background: rgba(251, 191, 36, 0.25);
  border-color: #fbbf24;
}

.mon-action-btn.btn-logs {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
}
.mon-action-btn.btn-logs:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
}


.mon-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  background: #1e293b;
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  pointer-events: none;
  z-index: 9999;
}

.mon-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.mon-toast.success {
  background: #064e3b;
  border-color: #10b981;
  color: #a7f3d0;
}

.mon-toast.error {
  background: #7f1d1d;
  border-color: #ef4444;
  color: #fecaca;
}

.mon-cancel-cmd-btn {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.mon-cancel-cmd-btn:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: #ef4444;
}

.mon-btn-unbind-pc {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 5px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 500;
  line-height: 1.2;
}
.mon-btn-unbind-pc:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
}


/* ==========================================================================
   СТИЛИ ДЛЯ МОДАЛЬНЫХ ОКОН (ПОДПИСЬ КЛИЕНТА И TELEGRAM)
   ========================================================================== */
.custom-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(7, 10, 19, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.custom-modal-box {
  width: 100%;
  max-width: 480px;
  background: #0d1424;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 35px rgba(99, 102, 241, 0.18);
  overflow: hidden;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-modal-overlay.active .custom-modal-box {
  transform: scale(1) translateY(0);
}

.custom-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.modal-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.16);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-icon-badge.tg-badge {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

.custom-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.25;
}

.custom-modal-subtitle {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

.custom-modal-body {
  padding: 1.4rem;
}

.modal-input-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
}

.modal-input-wrap {
  position: relative;
}

.modal-input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: #060913;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #f8fafc;
  font-size: 0.94rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.modal-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.28);
  background: #090e1c;
}

.modal-input::placeholder {
  color: #64748b;
}

.modal-input-hint {
  font-size: 0.76rem;
  color: #94a3b8;
  margin-top: 0.65rem;
  line-height: 1.45;
}

.custom-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.015);
}

.btn-modal-secondary {
  padding: 0.6rem 1.15rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-modal-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.btn-modal-primary {
  padding: 0.6rem 1.3rem;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border: 1px solid rgba(99, 102, 241, 0.5);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transition: all 0.2s ease;
}

.btn-modal-primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.5);
  transform: translateY(-1px);
}

.btn-modal-primary:active {
  transform: translateY(0);
}

.btn-inline-sig-edit {
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.32);
  border-radius: 4px;
  color: #818cf8;
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}
.btn-inline-sig-edit:hover {
  background: rgba(99, 102, 241, 0.28);
  border-color: #818cf8;
  color: #ffffff;
}

/* ================== КРАСНАЯ ОБВОДКА ПРИ СБОЕ СЛУЖБЫ ================== */
.compact-license-card.card-service-failed {
  border: 2px solid #ef4444 !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4) !important;
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.09) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
}

@keyframes pulse-danger-border {
  0% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.35); }
  50% { box-shadow: 0 0 22px rgba(239, 68, 68, 0.65); border-color: #f87171 !important; }
  100% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.35); }
}

.card-danger-banner {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-size: 0.76rem;
  color: #fca5a5;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* ================== КНОПКА СКАЧИВАНИЯ АГЕНТА ================== */
.btn-download-agent {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
  transition: all 0.2s ease;
}
.btn-download-agent:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.35) 0%, rgba(5, 150, 105, 0.35) 100%);
  border-color: #34d399;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-cabinet-download-agent {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  transition: all 0.2s ease;
}
.btn-cabinet-download-agent:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #34d399;
  color: #fff;
  transform: translateY(-1px);
}

/* ================== КАТЕГОРИИ И DRAG AND DROP ================== */
.monitoring-categories-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  padding: 0.5rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(100, 116, 139, 0.2);
  border-radius: 8px;
}

.cat-tab-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(100, 116, 139, 0.3);
  color: #94a3b8;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.18s ease;
}
.cat-tab-btn:hover {
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(49, 46, 129, 0.3);
}
.cat-tab-btn.active {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  color: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}
.cat-tab-btn.drop-zone-hover {
  background: rgba(16, 185, 129, 0.35) !important;
  border: 2px dashed #34d399 !important;
  color: #fff !important;
  transform: scale(1.05);
}

.btn-add-category {
  background: transparent;
  border: 1px dashed rgba(99, 102, 241, 0.4);
  color: #818cf8;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.18s ease;
}
.btn-add-category:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: #818cf8;
  color: #fff;
}

.dnd-hint-bar {
  font-size: 0.75rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding-left: 0.25rem;
}

.category-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  background: rgba(30, 41, 59, 0.5);
  border-left: 3px solid #6366f1;
  border-radius: 6px;
  margin: 1.25rem 0 0.85rem 0;
  transition: all 0.2s ease;
}
.category-group-header.drop-zone-hover {
  background: rgba(16, 185, 129, 0.25) !important;
  border-left-color: #34d399 !important;
  border: 2px dashed #34d399 !important;
}

.category-group-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.compact-license-card.is-dragging {
  opacity: 0.45;
  transform: scale(0.98);
  border: 2px dashed #6366f1 !important;
}

.card-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.35);
  cursor: pointer;
  transition: all 0.15s ease;
}
.card-category-badge:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: #818cf8;
  color: #c7d2fe;
}

/* ================== ЛОГИ И МОДАЛЬНОЕ ОКНО ЛОГОВ ================== */
.custom-modal-large {
  max-width: 860px !important;
  width: 95% !important;
}

.logs-badge {
  background: rgba(56, 189, 248, 0.15) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
}

.logs-summary-bar {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(100, 116, 139, 0.25);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: block;
  font-size: 0.82rem;
}

.logs-table-wrapper {
  border: 1px solid rgba(100, 116, 139, 0.25);
  border-radius: 8px;
  overflow: hidden;
  max-height: 48vh;
  overflow-y: auto;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}
.logs-table th {
  background: #0f172a;
  color: #94a3b8;
  padding: 0.55rem 0.75rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(100, 116, 139, 0.3);
  position: sticky;
  top: 0;
  z-index: 2;
}
.logs-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(100, 116, 139, 0.15);
  color: #e2e8f0;
}
.logs-table tr:hover {
  background: rgba(30, 41, 59, 0.5);
}

.log-pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}
.log-pill.problem {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.log-pill.recovered {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.log-pill.info {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}


/* ==========================================================================
   DEPLOYPULSE WORKPLACES GROUP AND CARD STYLING (MATCHING SCREENSHOT 2)
   ========================================================================== */

#compact-licenses-container {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 20px !important;
}

.workplaces-group-section {
    width: 100% !important;
    margin-bottom: 28px;
}

.workplaces-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(90deg, rgba(14, 20, 32, 0.7) 0%, rgba(14, 20, 32, 0.2) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.workplaces-group-header.drop-zone-hover {
    background: rgba(16, 185, 129, 0.2) !important;
    border: 1px dashed #34d399 !important;
}

.wp-group-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wp-group-drag-handle {
    color: rgba(255, 255, 255, 0.25);
    cursor: grab;
    display: flex;
    align-items: center;
}

.wp-group-drag-handle:hover {
    color: #06b6d4;
}

.wp-group-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #f8fafc;
    letter-spacing: 0.3px;
    cursor: pointer;
}

.wp-group-title:hover {
    color: #06b6d4;
}

.wp-group-btn-edit {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 3px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: all 0.15s ease;
}

.wp-group-btn-edit:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.wp-group-count {
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 400;
}

.wp-group-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wp-group-lock-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 5px 8px;
    color: #06b6d4;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.wp-group-lock-btn:hover {
    background: rgba(6, 182, 212, 0.15);
    border-color: #06b6d4;
}

/* Grid of Workstation Cards */
.workplaces-cards-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)) !important;
    gap: 16px !important;
    width: 100% !important;
}

.wp-empty-group-dropzone {
    grid-column: 1 / -1;
    padding: 24px;
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #64748b;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.wp-empty-group-dropzone.drop-zone-hover {
    border-color: #34d399 !important;
    background: rgba(16, 185, 129, 0.12) !important;
    color: #a7f3d0 !important;
}

/* Workplace Card */
.workplace-card {
    background: #0d1527;
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    padding: 18px 20px 14px 20px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    contain: content;
}

.workplace-card:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, 0.65);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(16, 185, 129, 0.15);
}

.workplace-card.is-offline {
    border-color: rgba(100, 116, 139, 0.22);
    background: #0b1120;
    box-shadow: none;
}

.workplace-card.is-offline:hover {
    border-color: rgba(100, 116, 139, 0.4);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.workplace-card.card-service-failed {
    border: 2px solid #ef4444 !important;
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.35), 0 4px 16px rgba(0, 0, 0, 0.5) !important;
}

.workplace-card.is-dragging {
    opacity: 0.45;
    transform: scale(0.98);
    border: 2px dashed #6366f1 !important;
}

/* Card Header */
.wp-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.wp-card-title-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.wp-monitor-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.wp-monitor-icon.offline {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
    border-color: rgba(100, 116, 139, 0.2);
}

.wp-monitor-pulse {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.wp-name-wrap {
    min-width: 0;
}

.wp-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wp-pc-name {
    font-size: 1.02rem;
    font-weight: 600;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 175px;
}

.wp-btn-edit-name {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.wp-btn-edit-name:hover {
    opacity: 1;
    color: #38bdf8;
}

.wp-org-name {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wp-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.wp-clock-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 600;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 6px;
    padding: 3px 8px;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: default;
}

.wp-clock-time:hover {
    background: rgba(56, 189, 248, 0.16);
    border-color: rgba(56, 189, 248, 0.4);
}

.wp-copy-key-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 4px 7px;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.18s ease;
}

.wp-copy-key-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Components List */
.wp-card-components {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0 14px 0;
}

.wp-comp-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.wp-comp-header-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.5px;
}

.wp-comp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.83rem;
    padding: 2px 0;
}

.wp-comp-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.wp-comp-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.wp-comp-dot.ok {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.wp-comp-dot.warn {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.wp-comp-name {
    color: #e2e8f0;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.wp-comp-version {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
}

.wp-comp-version.ver-ok {
    color: #38bdf8;
}

.wp-comp-version.ver-warn {
    color: #f87171;
}

/* Meta Data Grid (INN, ZN KKT, etc.) */
.wp-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 12px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(100, 116, 139, 0.15);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 12px;
}

.wp-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wp-meta-lbl {
    font-size: 0.68rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
}

.wp-meta-val {
    font-size: 0.8rem;
    color: #cbd5e1;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-edit-inn {
    background: none;
    border: none;
    color: #06b6d4;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
}

.btn-edit-inn:hover {
    color: #38bdf8;
}

/* Card Bottom */
.wp-card-bot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid rgba(100, 116, 139, 0.15);
    font-size: 0.76rem;
    color: #94a3b8;
    flex-wrap: wrap;
    gap: 6px;
}

/* Кнопка удаления группы (без эмодзи) */
.wp-group-btn-delete {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 3px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.wp-group-btn-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

/* Вкладки в журнале логов (без эмодзи) */
.logs-tabs-nav {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0 0 10px 0;
    margin: 12px 0 14px 0;
    flex-wrap: wrap;
}

.logs-tab-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #94a3b8;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.logs-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.logs-tab-btn.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.4);
    font-weight: 600;
}

/* Окно консольных логов и ошибок (терминальный стиль) */
.logs-console-window {
    background: #060911;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 14px 16px;
    font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
    font-size: 0.8rem;
    line-height: 1.55;
    color: #cbd5e1;
    max-height: 420px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.logs-console-line {
    padding: 3px 0;
    display: flex;
    gap: 8px;
}

.logs-console-line.error {
    color: #f87171;
}

.logs-console-line.warn {
    color: #fbbf24;
}

.logs-console-line.info {
    color: #94a3b8;
}

.logs-console-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #64748b;
    font-style: italic;
}


/* Кнопка принудительного обновления для gogo@mail.ru */
.btn-broadcast-update {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.2), rgba(249, 115, 22, 0.28));
  color: #fdba74;
  border: 1px solid rgba(249, 115, 22, 0.5);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.15);
}
.btn-broadcast-update:hover {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.35), rgba(249, 115, 22, 0.45));
  border-color: #f97316;
  color: #fff7ed;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.3);
  transform: translateY(-1px);
}
.btn-broadcast-update:active {
  transform: translateY(0);
}

/* ================== ГОРИЗОНТАЛЬНОЕ ОТОБРАЖЕНИЕ КАРТОЧЕК УСТРОЙСТВ (МАКСИМУМ 3 В РЯД) ================== */
.compact-cards-grid,
#compact-licenses-container,
.workplaces-cards-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 100% !important;
    margin-bottom: 2rem !important;
}

.compact-license-card {
    flex: 1 1 calc(33.333% - 11px) !important;
    min-width: 290px !important;
    max-width: calc(33.333% - 11px) !important;
    width: auto !important;
    box-sizing: border-box !important;
}

@media (max-width: 1050px) {
    .compact-license-card {
        flex: 1 1 calc(50% - 8px) !important;
        max-width: calc(50% - 8px) !important;
    }
}

@media (max-width: 680px) {
    .compact-license-card {
        flex: 1 1 100% !important;
        max-width: 100% !important;
    }
}

@media (min-width: 1750px) {
    .compact-license-card {
        flex: 1 1 320px !important;
        max-width: calc(25% - 12px) !important;
    }
}

@media (max-width: 768px) {
    .compact-license-card {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* Красная обводка при сбое службы */
.compact-license-card.card-service-failed.compact-license-card.card-service-failed {
    border: 2px solid #ef4444 !important;
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.45) !important;
}

/* Опции модального окна назначения группы */
.assign-group-option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.assign-group-option-item:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateX(2px);
}

.assign-group-option-item.selected {
    background: rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
}

.btn-assign-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.3);
}

.btn-assign-group:hover {
    color: #6366f1;
    border-color: rgba(99, 102, 241, 0.6);
}


/* ================== ГРУППЫ УСТРОЙСТВ И ПОДПИСИ (ОБНОВЛЕНИЕ) ================== */
.btn-add-group-top {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(129, 140, 248, 0.28));
  color: #a5b4fc;
  border: 1px solid rgba(129, 140, 248, 0.45);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-add-group-top:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(129, 140, 248, 0.45));
  color: #fff;
  border-color: #818cf8;
  transform: translateY(-1px);
}

.device-group-section {
  width: 100%;
  margin-bottom: 2rem;
  background: rgba(14, 21, 38, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.device-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.15rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 0.65rem;
}

.device-group-title-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.device-group-icon {
  font-size: 1.25rem;
}

.device-group-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.device-group-count {
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.35);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 12px;
}

.device-group-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-group-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  transition: all 0.15s ease;
}
.btn-group-action:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}
.btn-group-action.add {
  color: #38bdf8;
  border-color: rgba(6, 182, 212, 0.35);
  background: rgba(6, 182, 212, 0.1);
}
.btn-group-action.add:hover {
  background: rgba(6, 182, 212, 0.22);
  color: #7dd3fc;
  border-color: rgba(6, 182, 212, 0.6);
}
.btn-group-action.delete {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
}
.btn-group-action.delete:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fff;
}

/* Расположение устройств в группе — ГОРИЗОНТАЛЬНО */
.device-group-devices-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 1.15rem !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: 100% !important;
}

.device-group-empty-state {
  width: 100%;
  padding: 1.5rem 1rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.88rem;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

/* Бейдж группы на карточке устройства */
.card-group-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(99, 102, 241, 0.14);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.card-group-badge:hover {
  background: rgba(99, 102, 241, 0.28);
  border-color: #818cf8;
  color: #fff;
  transform: translateY(-1px);
}

/* ИСПРАВЛЕНИЕ: Имена при подписи помещаются полностью */
.compact-app-title {
  font-size: 0.98rem !important;
  font-weight: 700 !important;
  color: #fff !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow: visible !important;
  text-overflow: unset !important;
  line-height: 1.4 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 0.45rem !important;
}

.compact-app-title span[id^="card-sig-title"] {
  white-space: normal !important;
  word-break: break-word !important;
  overflow: visible !important;
  text-overflow: unset !important;
  display: inline !important;
  font-size: 0.98rem !important;
  line-height: 1.4 !important;
}

.compact-app-info {
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.65rem !important;
  min-width: 0 !important;
  flex: 1 1 220px !important;
}

.compact-card-top {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  gap: 0.75rem !important;
  flex-wrap: wrap !important;
}

.compact-license-card {
  flex: 1 1 340px !important;
  min-width: 310px !important;
  max-width: 520px !important;
}


/* Кнопка загрузки агента для админа */
.btn-upload-agent {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(56, 189, 248, 0.28));
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.15);
}
.btn-upload-agent:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.35), rgba(56, 189, 248, 0.45));
  border-color: #38bdf8;
  color: #f0f9ff;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}
.btn-upload-agent:active {
  transform: translateY(0);
}

.log-pill.active-failure {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.6);
  color: #fca5a5;
  font-weight: 700;
}


/* Кнопка 'Привязать Telegram' / 'Telegram привязан' */
.btn-bind-telegram {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.8rem;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.btn-bind-telegram:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  color: #f0f9ff;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.2);
  transform: translateY(-1px);
}
.btn-bind-telegram:active {
  transform: translateY(0);
}
.btn-bind-telegram.bound {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.35);
}
.btn-bind-telegram.bound:hover {
  background: rgba(34, 197, 94, 0.22);
  border-color: #4ade80;
  color: #f0fdf4;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.2);
}


/* Кнопка выбора файла агента */
.btn-file-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: rgba(30, 41, 59, 0.7);
  color: #38bdf8;
  border: 1px dashed rgba(56, 189, 248, 0.45);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
  box-sizing: border-box;
}
.btn-file-select:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: #38bdf8;
  color: #f0f9ff;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.15);
}
.btn-file-select:active {
  transform: translateY(0);
}


/* KKT and ESM details block in device card */
.mon-kkt-wrapper {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  margin: 0.55rem 0;
}

.mon-kkt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.mon-kkt-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.mon-kkt-model-name {
  font-weight: 700;
  font-size: 0.86rem;
  color: #f1f5f9;
}

.mon-kkt-zn-tag {
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  border-radius: 4px;
  padding: 0.12rem 0.45rem;
}

.mon-shift-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 14px;
}

.mon-shift-badge.shift-open {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.mon-shift-badge.shift-open .shift-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
}

.mon-shift-badge.shift-closed {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #94a3b8;
}

.mon-shift-badge.shift-closed .shift-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
}

.mon-kkt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.mon-kkt-col {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
}

.mon-kkt-subhdr {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #38bdf8;
  letter-spacing: 0.03em;
  padding-bottom: 0.3rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
}

.mon-kkt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.45rem;
  font-size: 0.74rem;
  line-height: 1.45;
  padding: 0.1rem 0;
}

.mon-kkt-row .kkt-lbl {
  color: #94a3b8;
  font-weight: 500;
  white-space: nowrap;
}

.mon-kkt-row .kkt-val {
  color: #e2e8f0;
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}



/* ==========================================================================
   FLAT DEVICE CARD (КОМПАКТНАЯ ШИРИНА, ЧЕТКИЙ ВЫВОД ККТ, БЕЗ СРЕЗАНИЯ И БЕЗ ЭМОДЗИ)
   ========================================================================== */

/* Компактный размер карточки устройства (устройств может быть много) */
.compact-license-card {
  flex: 1 1 350px !important;
  min-width: 320px !important;
  max-width: 440px !important;
  box-sizing: border-box !important;
  background: #0e1526;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  padding: 0.9rem 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
@media (max-width: 720px) {
  .compact-license-card {
    min-width: 100% !important;
    max-width: 100% !important;
  }
}

/* Кнопки действий с ключом: просмотр и копирование (без эмодзи) */
.compact-btn-key-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}
.compact-btn-key-action:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}
.compact-btn-key-action.btn-danger {
  color: #f87171;
}
.compact-btn-key-action.btn-danger:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
  color: #ef4444;
}

/* Кнопка редактирования подписи */
.btn-inline-sig-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 4px;
  transition: color 0.15s ease;
}
.btn-inline-sig-edit:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

/* Кнопки скачивания разрядности: Версия 64 и Версия 86 (простые, без лишних описаний) */
.btn-download-version {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1.15rem;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}
.btn-download-version:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateY(-1px);
}
.dl-badge-num {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dl-badge-num.x86-num {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}
.dl-badge-text {
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
}

/* Плоский контейнер устройства */
.flat-device-section {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.flat-device-section.empty {
  border-style: dashed;
  background: rgba(15, 23, 42, 0.3);
}

.flat-device-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.flat-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.flat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.flat-status-dot.online {
  background: #10b981;
  box-shadow: 0 0 7px rgba(16, 185, 129, 0.7);
}
.flat-status-dot.offline {
  background: #64748b;
}
.flat-device-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f8fafc;
}
.flat-ip-badge {
  font-size: 0.73rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
}
.flat-agent-ver {
  font-size: 0.73rem;
  color: #38bdf8;
  font-weight: 600;
}
.flat-header-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.mon-shift-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
}
.mon-shift-badge.shift-open {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.mon-shift-badge.shift-closed {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}
.shift-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.flat-last-seen {
  font-size: 0.72rem;
  color: #64748b;
}

/* Компактные блоки информации: ККТ и ЕСМ/ПО */
.flat-info-blocks {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.flat-block {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.flat-block-title {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #38bdf8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.25rem;
  margin-bottom: 0.15rem;
}
.flat-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.78rem;
  line-height: 1.35;
}
.f-lbl {
  color: #94a3b8;
  flex-shrink: 0;
  font-weight: 500;
  white-space: nowrap;
}
.f-val {
  color: #f1f5f9;
  font-weight: 600;
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  word-break: break-all;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
.f-val.highlight-val {
  color: #38bdf8;
  font-weight: 700;
}

/* Кассовые службы */
.flat-services-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.flat-services-caption {
  font-size: 0.74rem;
  color: #94a3b8;
  font-weight: 600;
}
.flat-services-tags {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.mon-svc-tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
.mon-svc-tag.svc-ok {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.mon-svc-tag.svc-fail {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  text-decoration: none;
}

/* Кнопки управления */
.mon-ctrl-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding-top: 0.25rem;
}
.mon-action-btn {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.32rem 0.65rem;
  border-radius: 5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mon-action-btn.btn-start {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}
.mon-action-btn.btn-start:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #34d399;
}
.mon-action-btn.btn-stop {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}
.mon-action-btn.btn-stop:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #f87171;
}
.mon-action-btn.btn-app-restart {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}
.mon-action-btn.btn-app-restart:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
}
.mon-action-btn.btn-logs {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.35);
}
.mon-action-btn.btn-logs:hover {
  background: rgba(148, 163, 184, 0.25);
  color: #f8fafc;
}

/* ========================================================
   DRAG AND DROP FOR DEVICES & GROUPS
   ======================================================== */
.card-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: grab;
  padding: 3px;
  border-radius: 4px;
  margin-right: 6px;
  transition: all 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}
.card-drag-handle:hover {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.18);
}
.compact-license-card {
  cursor: grab;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}
.compact-license-card:active {
  cursor: grabbing;
}
.compact-license-card.is-dragging {
  opacity: 0.35 !important;
  transform: scale(0.97) !important;
  border: 2px dashed #818cf8 !important;
  cursor: grabbing !important;
}
.device-group-section {
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.device-group-section.drop-zone-hover {
  border-color: #818cf8 !important;
  background: rgba(99, 102, 241, 0.14) !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5), 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}
.device-group-section.drop-zone-hover .device-group-title {
  color: #a5b4fc !important;
}
body.is-dragging-card * {
  user-select: none !important;
}

/* ========================================================
   DEVICE DETAILS MODAL & INDIVIDUAL SERVICE CONTROLS
   ======================================================== */
.badge-online-pulse {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
}
.dot-online {
  width: 7px;
  height: 7px;
  background: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 8px #34d399;
}
.badge-offline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
}
.dot-offline {
  width: 7px;
  height: 7px;
  background: #94a3b8;
  border-radius: 50%;
}
.btn-svc-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}
.btn-svc-start {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.btn-svc-start:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.32);
  border-color: #34d399;
  transform: translateY(-1px);
}
.btn-svc-stop {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}
.btn-svc-stop:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.32);
  border-color: #f87171;
  transform: translateY(-1px);
}
.btn-device-info {
  background: rgba(99, 102, 241, 0.18) !important;
  border-color: rgba(99, 102, 241, 0.4) !important;
  color: #a5b4fc !important;
}
.btn-device-info:hover {
  background: rgba(99, 102, 241, 0.32) !important;
  border-color: #818cf8 !important;
}
.flat-device-section {
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.flat-device-section:hover {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(99, 102, 241, 0.35);
}
.mon-svc-tag.svc-missing {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Кнопка вкладки Время и пользователи в хедере */
.btn-users-time-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-users-time-tab:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  border-color: #3b82f6;
}
.btn-users-time-tab.active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

body:not(.user-is-admin) #header-btn-users-time {
  display: none !important;
}

/* Кнопки фильтрации Время и пользователи */
.btn-ut-filter {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-ut-filter:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #f8fafc;
}
.btn-ut-filter.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: #6366f1;
  color: #fff;
}

/* Синяя рамка для демо-ключей */
.demo-key-outline {
  border: 2px solid #3b82f6 !important;
  border-radius: 6px;
  padding: 0.25rem 0.65rem;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa !important;
  font-weight: 700;
  font-family: monospace, monospace;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.25);
}

.commercial-key-box {
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 6px;
  padding: 0.25rem 0.65rem;
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  font-weight: 700;
  font-family: monospace, monospace;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.ut-card {
  background: #0e1526;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  transition: border-color 0.2s ease;
}
.ut-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}


/* ========================================================
   ОГРАНИЧЕНИЕ: МАКСИМУМ 3 КАРТОЧКИ В ГОРИЗОНТАЛЬНОМ РЯДУ
   ======================================================== */
.device-group-devices-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 1.15rem !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: 100% !important;
}

.device-group-devices-row .compact-license-card,
.compact-license-card {
  flex: 0 0 calc(33.333% - 0.77rem) !important;
  width: calc(33.333% - 0.77rem) !important;
  max-width: calc(33.333% - 0.77rem) !important;
  min-width: 310px !important;
  box-sizing: border-box !important;
}

@media (max-width: 1140px) {
  .device-group-devices-row .compact-license-card,
  .compact-license-card {
    flex: 0 0 calc(50% - 0.58rem) !important;
    width: calc(50% - 0.58rem) !important;
    max-width: calc(50% - 0.58rem) !important;
  }
}

@media (max-width: 720px) {
  .device-group-devices-row .compact-license-card,
  .compact-license-card {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
  }
}




/* Поиск и список пользователей в модальном окне */
.extend-mode-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.7);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.extend-mode-btn {
  flex: 1;
  padding: 0.5rem 0.8rem;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.extend-mode-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.04);
}
.extend-mode-btn.active {
  color: #ffffff !important;
  background: #2563eb !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}
.extend-demo-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.8rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.84rem;
}
.extend-demo-user-item:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
}
.extend-demo-user-item.selected {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

/* Наполнение шапки устройства для устранения пустого места */
.flat-device-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 0.65rem !important;
  padding: 0.65rem 0.95rem !important;
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.75) 100%) !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  margin-bottom: 0.75rem !important;
}
.flat-header-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  flex: 1 1 auto;
}
.flat-header-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.flat-remote-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.18rem 0.55rem;
  border-radius: 5px;
  font-family: monospace;
}
.flat-kkt-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.18rem 0.55rem;
  border-radius: 5px;
}


.flat-agent-id-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.28);
  padding: 0.18rem 0.55rem;
  border-radius: 5px;
  font-family: monospace;
  cursor: pointer;
  transition: all 0.15s ease;
}
.flat-agent-id-badge:hover {
  background: rgba(167, 139, 250, 0.22);
  border-color: rgba(167, 139, 250, 0.45);
}


/* Бейдж ID агента в карточке мониторинга */
.flat-agent-id-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.28);
  padding: 0.18rem 0.55rem;
  border-radius: 5px;
  font-family: monospace;
  cursor: pointer;
  transition: all 0.15s ease;
}
.flat-agent-id-badge:hover {
  background: rgba(167, 139, 250, 0.22);
  border-color: rgba(167, 139, 250, 0.45);
}

/* Бейдж ID агента во вкладке Время и пользователи */
.ut-id-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.3);
  padding: 2px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ut-id-badge:hover {
  background: rgba(167, 139, 250, 0.22);
  border-color: rgba(167, 139, 250, 0.5);
}


/* ========================================================
   РЕЖИМ ЕДИНОЧНОГО УСТРОЙСТВА (ПАНЕЛЬ УПРАВЛЕНИЯ ИЗ АГЕНТА)
   ======================================================== */
body.single-device-view #compact-licenses-container,
body.single-device-view .device-group-devices-row {
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
  width: 100% !important;
  max-width: 1040px !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

body.single-device-view .device-group-block {
  width: 100% !important;
  max-width: 1040px !important;
  margin: 0 auto !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

body.single-device-view .compact-license-card,
body.single-device-view .device-group-devices-row .compact-license-card {
  flex: 1 1 100% !important;
  width: 100% !important;
  max-width: 1040px !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
  padding: 1.5rem 1.75rem !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4) !important;
}

body.single-device-view .flat-info-blocks {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 1.25rem !important;
  margin-top: 0.65rem !important;
  margin-bottom: 0.65rem !important;
}

body.single-device-view .flat-block {
  padding: 0.95rem 1.25rem !important;
  gap: 0.55rem !important;
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
}

body.single-device-view .flat-row {
  font-size: 0.92rem !important;
  line-height: 1.6 !important;
}

body.single-device-view .f-lbl {
  font-size: 0.88rem !important;
  min-width: 160px !important;
}

body.single-device-view .f-val {
  font-size: 0.92rem !important;
}

body.single-device-view .flat-device-header {
  padding: 0.85rem 1.25rem !important;
  margin-bottom: 1.1rem !important;
}

body.single-device-view .flat-device-name {
  font-size: 1.1rem !important;
}

body.single-device-view .mon-services-flow {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.65rem !important;
  margin-top: 0.85rem !important;
}

body.single-device-view .mon-svc-tag {
  font-size: 0.84rem !important;
  padding: 0.35rem 0.75rem !important;
}

@media (max-width: 768px) {
  body.single-device-view .flat-info-blocks {
    grid-template-columns: 1fr !important;
  }
}


/* Кнопка активации лицензии в хедере и карточке */
.btn-header-activate {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22) 0%, rgba(5, 150, 105, 0.22) 100%);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-header-activate:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.38) 0%, rgba(5, 150, 105, 0.38) 100%);
  border-color: #34d399;
  color: #ffffff;
  transform: translateY(-1px);
}
.btn-activate-license {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}
.btn-activate-license:hover {
  background: rgba(16, 185, 129, 0.28) !important;
  color: #ffffff !important;
}
.ribbon-demo {
  animation: fadeIn 0.3s ease;
}
.svc-pending {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(59, 130, 246, 0.35) !important;
}


/* Full width & wide screen adaptation */
.device-group-devices-row .compact-license-card,
.compact-license-card {
  flex: 1 1 480px !important;
  min-width: 320px !important;
  max-width: 100% !important;
  width: auto !important;
}