@font-face {
  font-family: 'Tilda Sans VF';
  src: url('https://static.tildacdn.com/fonts/tildasans/TildaSans-VF.woff2') format('woff2-variations'),
       url('https://static.tildacdn.com/fonts/tildasans/TildaSans-VF.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

html {
  font-size: 80% !important;
  height: 100%;
}

/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  /* Colors */
  --bg-dark: #07080c;
  --bg-card: rgba(18, 22, 33, 0.75);
  --bg-input: rgba(10, 12, 18, 0.6);
  
  --neon-cyan: #00f3ff;
  --neon-cyan-glow: rgba(0, 243, 255, 0.4);
  --neon-magenta: #ff007f;
  --neon-magenta-glow: rgba(255, 0, 127, 0.3);
  --neon-green: #39ff14;
  --neon-green-glow: rgba(57, 255, 20, 0.4);
  --neon-red: #ff3333;
  --neon-red-glow: rgba(255, 51, 51, 0.4);

  --text-primary: #ffffff;
  --text-secondary: #8e9cae;
  --text-muted: #4e5b6c;
  
  --border-neon: rgba(0, 243, 255, 0.2);
  --border-neon-active: rgba(0, 243, 255, 0.8);
  
  /* Layout */
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* ==========================================================================
   LIGHT THEME DESIGN SYSTEM
   ========================================================================== */
html[data-theme="light"] {
  --bg-dark: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;

  --neon-cyan: #0284c7;
  --neon-cyan-glow: rgba(2, 132, 199, 0.2);
  --neon-magenta: #d946ef;
  --neon-magenta-glow: rgba(217, 70, 239, 0.2);
  --neon-green: #16a34a;
  --neon-green-glow: rgba(22, 163, 74, 0.2);
  --neon-red: #ef4444;
  --neon-red-glow: rgba(239, 68, 68, 0.2);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --border-neon: rgba(2, 132, 199, 0.25);
  --border-neon-active: rgba(2, 132, 199, 0.7);
}

/* 1. Базовые переопределения */
html[data-theme="light"] body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

/* 2. Шапка (Header) */
html[data-theme="light"] .header {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .brand-text {
  color: #0f172a !important;
}

html[data-theme="light"] .header-controls .btn-notify,
html[data-theme="light"] .header-controls .btn-logout,
html[data-theme="light"] .header-controls .btn-theme-toggle {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

html[data-theme="light"] .header-controls .btn-notify:hover,
html[data-theme="light"] .header-controls .btn-logout:hover,
html[data-theme="light"] .header-controls .btn-theme-toggle:hover {
  background: #f0f9ff !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

html[data-theme="light"] .search-wrapper input.global-search {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

html[data-theme="light"] .search-wrapper input.global-search::placeholder {
  color: #94a3b8 !important;
}

/* 3. Подвал (Footer / Status Bar) */
html[data-theme="light"] .app-footer {
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
  color: #475569 !important;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="light"] .app-footer span,
html[data-theme="light"] .app-footer div,
html[data-theme="light"] .footer-brand,
html[data-theme="light"] .footer-status {
  color: #475569 !important;
}

/* 4. Меню Бургера (Workspace Floating Menu) */
html[data-theme="light"] .workspace-menu .trigger-btn {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="light"] .workspace-menu .trigger-btn i,
html[data-theme="light"] .workspace-menu .trigger-btn svg {
  color: #0f172a !important;
}

html[data-theme="light"] .menu-btn.item-btn {
  background: #ffffff !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="light"] .menu-btn.item-btn:hover {
  color: #0284c7 !important;
  border-color: #0284c7 !important;
  background: #f0f9ff !important;
}

html[data-theme="light"] .menu-btn.item-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.3) !important;
}

/* 5. Плавающая кнопка поиска / Чат AI */
html[data-theme="light"] #agent-chat-trigger {
  background: #0284c7 !important;
  border: 1px solid #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.3) !important;
}

/* 6. Карточки, Дэшборды и Заголовки */
html[data-theme="light"] .cyber-title,
html[data-theme="light"] .glow-text {
  color: #0f172a !important;
  text-shadow: none !important;
  filter: none !important;
  font-weight: 800 !important;
}

html[data-theme="light"] .cyber-card,
html[data-theme="light"] .kpi-card,
html[data-theme="light"] .table-wrapper,
html[data-theme="light"] .kb-card,
html[data-theme="light"] .notifications-dropdown,
html[data-theme="light"] .users-dropdown,
html[data-theme="light"] #agent-chat-panel {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .kpi-card h3,
html[data-theme="light"] .kpi-value,
html[data-theme="light"] .kpi-title {
  color: #0f172a !important;
}

/* 7. Вкладки (Tabs) Базы Знаний */
html[data-theme="light"] .kb-tab-btn,
html[data-theme="light"] .tab-btn {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}

html[data-theme="light"] .kb-tab-btn:hover,
html[data-theme="light"] .tab-btn:hover {
  background: #f0f9ff !important;
  color: #0284c7 !important;
  border-color: #bae6fd !important;
}

html[data-theme="light"] .kb-tab-btn.active,
html[data-theme="light"] .tab-btn.active {
  background: #ffffff !important;
  color: #0284c7 !important;
  border: 2px solid #0284c7 !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.12) !important;
  font-weight: 700 !important;
}

/* 8. Канбан-доска (Задачи) */
html[data-theme="light"] .kanban-column,
html[data-theme="light"] .tasks-column {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .kanban-column-header h3 {
  color: #0f172a !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .kanban-column-header .task-count {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
}

html[data-theme="light"] .task-card {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .task-card:hover {
  border-color: #0284c7 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.15) !important;
}

html[data-theme="light"] .task-card-title,
html[data-theme="light"] .task-card h3,
html[data-theme="light"] .task-card h4 {
  color: #0f172a !important;
}

html[data-theme="light"] .task-card-desc,
html[data-theme="light"] .task-card-project,
html[data-theme="light"] .task-card-meta,
html[data-theme="light"] .task-user {
  color: #475569 !important;
}

/* 9. Таблицы в Светлой Теме */
html[data-theme="light"] .cyber-table th {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-bottom: 2px solid #e2e8f0 !important;
}

html[data-theme="light"] .cyber-table td {
  border-bottom: 1px solid #f1f5f9 !important;
  color: #334155 !important;
}

html[data-theme="light"] .cyber-table tr:hover td {
  background: #f0f9ff !important;
}

/* 10. Модальные окна и Инпуты */
html[data-theme="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.5) !important;
  backdrop-filter: blur(4px) !important;
}

html[data-theme="light"] .modal-card,
html[data-theme="light"] .modal-content {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
}

html[data-theme="light"] .modal-header h2,
html[data-theme="light"] .modal-header h3 {
  color: #0f172a !important;
}

html[data-theme="light"] .btn-close-modal {
  color: #64748b !important;
}

html[data-theme="light"] .btn-close-modal:hover {
  color: #0f172a !important;
}

html[data-theme="light"] .equipment-section,
html[data-theme="light"] .section-group {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
}

html[data-theme="light"] .equipment-section .section-header {
  color: #0f172a !important;
}

html[data-theme="light"] .equipment-section .section-header span {
  color: #1e293b !important;
  font-weight: 700 !important;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus {
  background: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: #94a3b8 !important;
}

html[data-theme="light"] option {
  background: #ffffff !important;
  color: #0f172a !important;
}

option.option-country {
  color: #ffb703;
}

html[data-theme="light"] option.option-country {
  color: #d97706 !important;
  font-weight: 600 !important;
}

/* 11. Переключатель темы (Button) */
html[data-theme="light"] .btn-theme-toggle {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #0284c7 !important;
}

html[data-theme="light"] .btn-theme-toggle:hover {
  background: #f0f9ff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.2) !important;
}

.btn-theme-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffb703;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 183, 3, 0.4);
  box-shadow: 0 0 12px rgba(255, 183, 3, 0.2);
}

.btn-theme-toggle:active {
  transform: scale(0.93);
}

.btn-theme-toggle i,
.btn-theme-toggle svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent; /* Отключение подсветки тапов */
}

body {
  font-family: 'Tilda Sans VF', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  overflow: hidden; /* Запрет глобального скролла */
  height: 100%;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -20%;
  width: 140%;
  height: 140%;
  background: radial-gradient(circle at 80% 20%, rgba(255, 0, 127, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 20% 80%, rgba(0, 243, 255, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding-top: var(--safe-area-top);
  padding-bottom: var(--safe-area-bottom);
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   HEADER & SMART SEARCH
   ========================================================================== */
.app-header {
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(0, 243, 255, 0.1);
  background: rgba(7, 8, 12, 0.8);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  color: var(--neon-cyan);
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 0 6px var(--neon-cyan-glow));
  animation: pulse-neon 2s infinite ease-in-out;
}

.brand-text {
  font-family: 'Tilda Sans VF', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 2px;
  line-height: 1;
  transform: translateY(2.5px);
  background: linear-gradient(90deg, #ffffff, var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Обертка глобального поиска */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.3s ease;
}

.global-search {
  width: 140px;
  height: 36px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 0 12px 0 34px;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.global-search:focus {
  width: 200px;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.global-search:focus + .search-icon {
  color: var(--neon-cyan);
}

.server-status-wrapper {
  position: relative;
  display: inline-block;
}

.server-status-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
}

.server-status-btn:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan-glow);
}

.users-dropdown {
  position: absolute;
  top: 42px;
  right: 0;
  width: 280px;
  background: rgba(7, 8, 12, 0.98);
  border: 1px solid var(--border-neon);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 243, 255, 0.1);
  display: none;
  flex-direction: column;
  z-index: 200;
  animation: dropdownFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.users-dropdown.active {
  display: flex;
}

.users-dropdown-header {
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--neon-cyan);
  border-bottom: 1px solid rgba(0, 243, 255, 0.1);
  text-shadow: 0 0 5px var(--neon-cyan-glow);
}

.users-dropdown-list {
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 243, 255, 0.2) transparent;
}

.users-dropdown-list::-webkit-scrollbar {
  width: 4px;
}

.users-dropdown-list::-webkit-scrollbar-thumb {
  background: rgba(0, 243, 255, 0.2);
  border-radius: 2px;
}

.users-dropdown-loading, .users-dropdown-empty {
  padding: 20px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.users-dropdown-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.2s ease;
}

.users-dropdown-item:last-child {
  border-bottom: none;
}

.users-dropdown-item:hover {
  background: rgba(0, 243, 255, 0.05);
}

.users-dropdown-item .user-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.users-dropdown-item .user-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.users-dropdown-item .user-email {
  font-size: 0.7rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.users-dropdown-item .user-last-login {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.online {
  background-color: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
}

.notifications-dropdown {
  position: absolute;
  top: 42px;
  right: 0;
  width: 320px;
  background: rgba(7, 8, 12, 0.98);
  border: 1px solid var(--border-neon);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 243, 255, 0.1);
  display: none;
  flex-direction: column;
  z-index: 200;
  animation: dropdownFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Мобильная адаптация колокольчика */
@media (max-width: 600px) {
  .notifications-dropdown {
    position: fixed;
    top: 60px;
    left: 10px;
    right: 10px;
    width: auto;
    max-height: calc(100vh - 80px);
    border-radius: 10px;
    z-index: 9999;
    overflow: hidden;
  }
  .notifications-dropdown-list {
    max-height: calc(100vh - 160px) !important;
  }
}

.notifications-dropdown.active {
  display: flex;
}

.notifications-dropdown-header {
  padding: 10px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--neon-cyan);
  border-bottom: 1px solid rgba(0, 243, 255, 0.1);
  text-shadow: 0 0 5px var(--neon-cyan-glow);
}

.notifications-dropdown-list {
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 243, 255, 0.2) transparent;
}

.notifications-dropdown-list::-webkit-scrollbar {
  width: 4px;
}

.notifications-dropdown-list::-webkit-scrollbar-thumb {
  background: rgba(0, 243, 255, 0.2);
  border-radius: 2px;
}

.notifications-dropdown-empty {
  padding: 20px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.notifications-dropdown-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.2s ease;
  cursor: pointer;
}

.notifications-dropdown-item:last-child {
  border-bottom: none;
}

.notifications-dropdown-item:hover {
  background: rgba(0, 243, 255, 0.05);
}

.notifications-dropdown-item .notify-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.notifications-dropdown-item .notify-desc {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.notifications-dropdown-item .notify-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: right;
}
.status-dot.offline {
  background-color: var(--neon-red);
  box-shadow: 0 0 8px var(--neon-red);
}

.btn-logout {
  background: transparent;
  border: 1px solid rgba(255, 51, 51, 0.2);
  color: var(--neon-red);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 25;
}

.btn-logout i {
  width: 16px;
  height: 16px;
}

.btn-logout:active {
  background: rgba(255, 51, 51, 0.1);
  box-shadow: 0 0 10px var(--neon-red-glow);
  transform: scale(0.92);
}

/* === ОБЁРТКА КОЛОКОЛЬЧИКА === */
.notifications-wrapper {
  position: relative;
  /* overflow visible чтобы бейдж не обрезался */
  overflow: visible;
  /* Небольшой левый отступ — бейдж выходит за левую границу кнопки */
  margin-left: 6px;
}

/* === КНОПКА КОЛОКОЛЬЧИКА (shadcn-style) === */
.btn-notify {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  outline: none;
}

.btn-notify:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(0, 243, 255, 0.4);
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.15);
}

.btn-notify:focus-visible {
  outline: 2px solid rgba(0, 243, 255, 0.6);
  outline-offset: 2px;
}

.btn-notify:active {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(0.93);
}

.btn-notify i,
.btn-notify svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
  flex-shrink: 0;
}

/* Бейдж в стиле shadcn — числовой, снаружи кнопки */
.notify-badge {
  position: absolute;
  /* Позиция как в shadcn: -top-2 left-full -translate-x-1/2 */
  top: -8px;
  left: 100%;
  transform: translateX(-50%);
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: #ef4444;
  color: #ffffff;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0;
  line-height: 20px;
  text-align: center;
  white-space: nowrap;
  border: 2px solid var(--bg-primary, #07080c);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  /* Анимация появления */
  animation: badgePop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  z-index: 10;
}

@keyframes badgePop {
  from { transform: translateX(-50%) scale(0.4); opacity: 0; }
  to   { transform: translateX(-50%) scale(1);   opacity: 1; }
}

/* ==========================================================================
   MAIN AREA
   ========================================================================== */
.app-main {
  position: relative; /* Необходим для абсолютного размещения контейнера workspace */
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
}

.auth-wrapper {
  position: relative;
  width: 100%;
  z-index: 5;
}

.auth-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 105%;
  height: 105%;
  background: radial-gradient(circle, rgba(0, 243, 255, 0.12) 0%, transparent 60%);
  filter: blur(10px);
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  background: var(--bg-card);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-neon);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.auth-card:focus-within {
  border-color: rgba(0, 243, 255, 0.5);
  box-shadow: 0 10px 40px rgba(0, 243, 255, 0.1);
}

.card-header, .panel-header {
  text-align: center;
  margin-bottom: 20px;
}

.card-header h2, .panel-header h2 {
  font-family: 'Tilda Sans VF', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 3px;
  margin-bottom: 6px;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.card-header p, .panel-header p {
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.4;
}

/* ==========================================================================
   INPUTS & BUTTONS (BASE)
   ========================================================================== */

/* Базовый скрытый класс для форм с анимацией */
.auth-form {
  display: none;
  flex-direction: column;
  gap: 14px;
}

/* Класс активации с плавной премиальной анимацией */
.auth-form.active {
  display: flex;
  animation: formFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes formFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-family: 'Tilda Sans VF', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-secondary);
  padding-left: 4px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  transition: color 0.3s ease;
}

.input-wrapper input,
.input-wrapper textarea {
  width: 100%;
  height: 50px; /* Крупная зона для тача по Mobile-First */
  background-color: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0 16px 0 46px; /* Отступ слева под иконку */
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-wrapper textarea {
  height: auto;
  padding: 12px 16px 12px 46px;
  min-height: 80px;
  resize: vertical;
}

/* Если в обертке только инпут (например, Фамилия, Имя) */
.input-wrapper input:only-child,
.input-wrapper textarea:only-child {
  padding-left: 16px;
}

.input-wrapper input::placeholder,
.input-wrapper textarea::placeholder {
  color: var(--text-muted);
}

.input-wrapper input:focus,
.input-wrapper textarea:focus {
  background-color: rgba(10, 12, 18, 0.9);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.15);
}

.input-wrapper input:focus + .input-icon {
  color: var(--neon-cyan);
}

/* Кнопка показа/скрытия пароля */
.btn-toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.25s ease;
  z-index: 2;
}

.btn-toggle-password i {
  width: 18px;
  height: 18px;
}

.btn-toggle-password:active {
  color: var(--neon-cyan);
}

/* Кнопка отправки формы */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  background: linear-gradient(135deg, #005c8a 0%, #0099b8 50%, #00f3ff 100%);
  border: none;
  border-radius: 14px;
  color: #000000;
  font-family: 'Tilda Sans VF', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 243, 255, 0.25);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-submit:active {
  transform: scale(0.97);
}

/* Ссылки переключения форм */
.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 4px;
}

.auth-links a {
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.auth-links a:hover {
  color: var(--neon-cyan);
  text-shadow: 0 0 8px var(--neon-cyan-glow);
}

/* ==========================================================================
   WORKSPACE CONTAINER & MODULES
   ========================================================================== */
.workspace-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  z-index: 10;
  animation: workspaceFadeIn 0.5s ease-out forwards;
}

@keyframes workspaceFadeIn {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: scale(1); }
}

.workspace-content {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 243, 255, 0.15) transparent;
}

/* Стилизация скроллбара рабочей области */
.workspace-content::-webkit-scrollbar {
  width: 6px;
}
.workspace-content::-webkit-scrollbar-track {
  background: transparent;
}
.workspace-content::-webkit-scrollbar-thumb {
  background: rgba(0, 243, 255, 0.15);
  border-radius: 10px;
}
.workspace-content::-webkit-scrollbar-thumb:hover {
  background: var(--neon-cyan);
}

.workspace-module {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  animation: moduleSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.workspace-module.active {
  display: flex;
}

#module-tasks {
  overflow: hidden;
}



@keyframes moduleSlideIn {
  from {
    opacity: 0;
    transform: translateX(15px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==========================================================================
   HAMBURGER MENU-BURGER (SPRINGY VEER/CASCADE)
   ========================================================================== */
.workspace-menu {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.menu-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 1px solid var(--border-neon);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), 
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
}

.menu-btn i {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease, stroke-width 0.3s ease;
}

.menu-btn:hover {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px var(--neon-cyan-glow);
}

.menu-btn:hover i {
  transform: scale(1.15);
  stroke-width: 2.5px;
}

/* Главная кнопка триггера */
.trigger-btn {
  background: linear-gradient(135deg, #121621 0%, #002e47 100%);
  z-index: 5;
}

.workspace-menu.expanded .trigger-btn {
  border-color: var(--neon-magenta);
  box-shadow: 0 0 12px var(--neon-magenta-glow);
  color: var(--neon-magenta);
  transform: rotate(90deg);
}

/* Контейнер элементов меню */
.menu-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.workspace-menu.expanded .menu-items {
  pointer-events: auto;
}

/* Стиль круглых кнопок выпадающего списка */
.item-btn {
  opacity: 0;
  transform: translateY(-15px) scale(0.6);
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              color 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

/* Открытое состояние: веер опускается с пружиной */
.workspace-menu.expanded .item-btn {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Математическая точность задержек (Каскадный эффект на открытие) */
.workspace-menu.expanded .item-btn:nth-child(1) { transition-delay: 0.05s; }
.workspace-menu.expanded .item-btn:nth-child(2) { transition-delay: 0.10s; }
.workspace-menu.expanded .item-btn:nth-child(3) { transition-delay: 0.15s; }
.workspace-menu.expanded .item-btn:nth-child(4) { transition-delay: 0.20s; }

/* Реверсивные задержки при закрытии (складывание в обратном порядке) */
.item-btn:nth-child(1) { transition-delay: 0.15s; }
.item-btn:nth-child(2) { transition-delay: 0.10s; }
.item-btn:nth-child(3) { transition-delay: 0.05s; }
.item-btn:nth-child(4) { transition-delay: 0s; }

/* Активная кнопка меню */
.item-btn.active {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  background: #081721;
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.2);
}

/* ==========================================================================
   GLOWING TITLE & CYBER MODULE
   ========================================================================== */
.cyber-screen {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 20px;
  padding: 0;
  overflow: visible;
}

/* Эффект сетки сканирования */
.cyber-screen::after {
  display: none;
}

.scanline {
  display: none;
}

@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

.cyber-title-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 100%;
  margin-bottom: 8px;
}

.cyber-title {
  font-family: 'Tilda Sans VF', sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.5rem);
  font-weight: 900;
  text-align: center;
  letter-spacing: 4px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffffff 0%, var(--neon-cyan) 50%, var(--neon-magenta) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(0, 243, 255, 0.3));
  animation: glow-pulse 3s infinite ease-in-out;
}

@keyframes glow-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(0, 243, 255, 0.3)) drop-shadow(0 0 2px rgba(255, 0, 127, 0.2));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 25px rgba(0, 243, 255, 0.6)) drop-shadow(0 0 8px rgba(255, 0, 127, 0.4));
    transform: scale(1.02);
  }
}

/* ==========================================================================
   ДЭШБОРД: KPI-КАРТОЧКИ С ЦВЕТОВЫМ АКЦЕНТОМ
   ========================================================================== */
.kpi-card {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: rgba(10, 15, 26, 0.7);
  backdrop-filter: blur(8px);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--kpi-accent, var(--neon-cyan)), transparent 90%);
  box-shadow: 0 0 12px var(--kpi-accent, var(--neon-cyan));
  opacity: 0.9;
}

.kpi-card:hover {
  transform: translateY(-4px);
}

.kpi-card--cyan { --kpi-accent: #00f3ff; }
.kpi-card--magenta { --kpi-accent: #ff007f; }
.kpi-card--green { --kpi-accent: #39ff14; }

.kpi-card--cyan:hover { box-shadow: 0 10px 30px rgba(0, 243, 255, 0.22) !important; border-color: rgba(0, 243, 255, 0.4) !important; }
.kpi-card--magenta:hover { box-shadow: 0 10px 30px rgba(255, 0, 127, 0.22) !important; border-color: rgba(255, 0, 127, 0.4) !important; }
.kpi-card--green:hover { box-shadow: 0 10px 30px rgba(57, 255, 20, 0.22) !important; border-color: rgba(57, 255, 20, 0.4) !important; }

.kpi-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
  animation: kpi-icon-pulse 2.6s infinite ease-in-out;
}

.kpi-icon-box--cyan {
  background: rgba(0, 243, 255, 0.12);
  border: 1px solid rgba(0, 243, 255, 0.4);
  box-shadow: inset 0 0 15px rgba(0, 243, 255, 0.1);
}
.kpi-icon-box--magenta {
  background: rgba(255, 0, 127, 0.12);
  border: 1px solid rgba(255, 0, 127, 0.4);
  box-shadow: inset 0 0 15px rgba(255, 0, 127, 0.1);
}
.kpi-icon-box--green {
  background: rgba(57, 255, 20, 0.12);
  border: 1px solid rgba(57, 255, 20, 0.4);
  box-shadow: inset 0 0 15px rgba(57, 255, 20, 0.1);
}

.kpi-badge-pct {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0, 243, 255, 0.12);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 243, 255, 0.3);
  margin-left: 6px;
  vertical-align: middle;
}

.kpi-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
}

.kpi-chip--success {
  background: rgba(22, 163, 74, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.kpi-chip--cyan {
  background: rgba(2, 132, 199, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.kpi-chip-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.kpi-progress-bar {
  display: flex;
  gap: 3px;
  height: 8px;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 10px;
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px;
}

.kpi-bar-segment {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-bar-segment:hover {
  filter: brightness(1.3);
}

/* Светлая тема для KPI */
html[data-theme="light"] .kpi-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .kpi-progress-bar {
  background: #e2e8f0 !important;
}

@keyframes kpi-icon-pulse {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.35); transform: scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .kpi-icon-box { animation: none; }
}

/* ==========================================================================
   ОБЩИЙ КОРПОРАТИВНЫЙ ЧАТ (Внизу слева)
   ========================================================================== */
#general-chat-widget {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 4500;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

#general-chat-bubble {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f172a, #0284c7);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), 0 0 18px rgba(2, 132, 199, 0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  outline: none;
}

#general-chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), 0 0 26px rgba(56, 189, 248, 0.5);
}

.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  border: 2px solid #0f172a;
}

#general-chat-panel {
  position: relative;
  z-index: 4500;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 100px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(2, 132, 199, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#general-chat-header {
  padding: 14px 16px;
  background: rgba(30, 41, 59, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

#general-chat-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#general-chat-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.chat-messages-container {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-msg-item {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

.chat-msg-item--own {
  align-self: flex-end;
}

.chat-msg-item--other {
  align-self: flex-start;
}

.chat-msg-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  margin-bottom: 3px;
  color: var(--text-muted);
}

.chat-msg-author {
  font-weight: 700;
  color: #38bdf8;
}

.chat-msg-role {
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.chat-msg-bubble {
  position: relative;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.4;
  word-break: break-word;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.chat-msg-delete-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, background 0.2s;
}
.chat-msg-delete-btn:hover {
  transform: scale(1.15);
  background: #dc2626;
}

.chat-msg-item--own:hover .chat-msg-delete-btn {
  display: flex;
}

.chat-msg-bubble--deleted {
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--text-muted) !important;
  font-style: italic !important;
  border: 1px dashed rgba(255, 255, 255, 0.15) !important;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem !important;
}

html[data-theme="light"] .chat-msg-bubble--deleted {
  background: #f8fafc !important;
  color: #64748b !important;
  border: 1px dashed #cbd5e1 !important;
}

.chat-msg-item--own .chat-msg-bubble {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

.chat-msg-item--other .chat-msg-bubble {
  background: #1e293b;
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 2px;
}

.chat-msg-img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  margin-top: 6px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-msg-file-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  margin-top: 6px;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
}

.chat-file-preview-bar {
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-input-form {
  padding: 10px 12px;
  background: rgba(30, 41, 59, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-attach-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.chat-attach-btn:hover {
  color: #38bdf8;
}

#general-chat-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
}
#general-chat-input:focus {
  border-color: #38bdf8;
}

.chat-send-btn {
  background: #0284c7;
  border: none;
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.chat-send-btn:hover {
  background: #0369a1;
}

.chat-mentions-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  margin-bottom: 6px;
  background: #1e293b;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  max-height: 160px;
  overflow-y: auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.chat-mention-item {
  padding: 8px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}
.chat-mention-item:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

/* Светлая тема для Чата */
html[data-theme="light"] #general-chat-panel {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12) !important;
}

html[data-theme="light"] #general-chat-header {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .chat-msg-item--other .chat-msg-bubble {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .chat-input-form {
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] #general-chat-input {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .chat-mentions-menu {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
}

html[data-theme="light"] .chat-mention-item {
  color: #0f172a !important;
}
html[data-theme="light"] .chat-mention-item:hover {
  background: #f1f5f9 !important;
}

.chat-emoji-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 6px;
  background: #1e293b;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 10px;
  width: 260px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.chat-emoji-item {
  font-size: 1.25rem;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  user-select: none;
  transition: transform 0.15s, background 0.15s;
}
.chat-emoji-item:hover {
  background: rgba(56, 189, 248, 0.2);
  transform: scale(1.2);
}

html[data-theme="light"] .chat-emoji-picker {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12) !important;
}

html[data-theme="light"] .chat-emoji-item:hover {
  background: #f1f5f9 !important;
}

/* ==========================================================================
   ИИ-АГЕНТ ЧАТА: пузырь + панель переписки
   ========================================================================== */
#agent-chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

#agent-chat-bubble {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a1420, #001a24);
  border: 1px solid var(--border-neon);
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 18px rgba(0, 243, 255, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  outline: none;
  animation: agent-bubble-pulse 3s infinite ease-in-out;
}

#agent-chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6), 0 0 26px rgba(0, 243, 255, 0.4);
}

@keyframes agent-bubble-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 18px rgba(0, 243, 255, 0.25); }
  50% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 28px rgba(0, 243, 255, 0.5); }
}

@media (prefers-reduced-motion: reduce) {
  #agent-chat-bubble { animation: none; }
}

#agent-chat-panel {
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 120px);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-neon);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(0, 243, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: dropdownFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#agent-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-primary);
  flex-shrink: 0;
}

#agent-chat-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#agent-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-chat-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.agent-chat-msg--bot {
  align-self: flex-start;
  background: rgba(0, 243, 255, 0.06);
  border: 1px solid rgba(0, 243, 255, 0.15);
  color: var(--text-primary);
  border-bottom-left-radius: 2px;
}

.agent-chat-msg--typing {
  align-self: flex-start;
  color: var(--text-muted);
  font-style: italic;
}

#agent-chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  flex-shrink: 0;
}

.agent-search-section {
  margin-bottom: 14px;
}
.agent-search-section:last-child {
  margin-bottom: 0;
}

.agent-search-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--neon-cyan);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.agent-search-item {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.agent-search-item:last-child {
  border-bottom: none;
}

.agent-search-item-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.agent-search-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

#agent-chat-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 0 10px;
  font-size: 0.78rem;
  font-family: inherit;
  outline: none;
}

#agent-chat-input:focus {
  border-color: var(--neon-cyan);
}

@media (max-width: 480px) {
  #agent-chat-widget {
    right: 12px;
    bottom: 12px;
  }
  #agent-chat-panel {
    width: calc(100vw - 24px);
    height: 68vh;
  }
}

.system-status-panel {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2;
}

.status-grid {
  display: flex;
  gap: 12px;
}

.status-item {
  flex: 1;
  background: rgba(18, 22, 33, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-label {
  font-family: 'Tilda Sans VF', sans-serif;
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.status-val {
  font-family: 'Tilda Sans VF', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.status-val.text-green {
  color: var(--neon-green);
  text-shadow: 0 0 5px var(--neon-green-glow);
}

.status-val.text-cyan {
  color: var(--neon-cyan);
  text-shadow: 0 0 5px var(--neon-cyan-glow);
}

.operator-badge-embedded {
  background: rgba(18, 22, 33, 0.85);
  border: 1px solid rgba(0, 243, 255, 0.15);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.badge-title {
  font-family: 'Tilda Sans VF', sans-serif;
  font-size: 0.65rem;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.badge-email {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--neon-cyan);
  word-break: break-all;
  text-shadow: 0 0 5px var(--neon-cyan-glow);
}

.badge-role {
  font-family: 'Tilda Sans VF', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 6px;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.badge-role.text-magenta {
  color: var(--neon-magenta);
  text-shadow: 0 0 5px var(--neon-magenta-glow);
}

.badge-role.text-cyan {
  color: var(--neon-cyan);
  text-shadow: 0 0 5px var(--neon-cyan-glow);
}

/* ==========================================================================
   MODULE PROJECTS & B2B SPECIFICS
   ========================================================================== */
.module-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-neon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  background: transparent;
  border: 1px solid var(--neon-cyan);
  border-radius: 14px;
  color: var(--neon-cyan);
  font-family: 'Tilda Sans VF', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 0 10px var(--neon-cyan-glow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.btn-neon:hover {
  background: var(--neon-cyan);
  color: #000000;
  box-shadow: 0 0 20px var(--neon-cyan);
}

.btn-neon i {
  width: 16px;
  height: 16px;
}

.projects-list-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   PROJECTS TOOLBAR & TOOLS PANEL
   ========================================================================== */
.projects-toolbar-wrapper {
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-neon);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideDownPanel 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Кнопка открытия панели инструментов */
.btn-neon-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--neon-cyan);
  height: 48px;
  padding: 0 16px;
  font-family: 'Tilda Sans VF', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 14px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s ease-in-out;
}

.btn-neon-outline:hover {
  background: rgba(0, 243, 255, 0.05);
  text-shadow: 0 0 4px var(--neon-cyan);
}

.btn-neon-outline i {
  width: 14px;
  height: 14px;
}

.eq-status-filter-btn {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: var(--text-secondary) !important;
}

.eq-status-filter-btn.active {
  border-color: var(--neon-cyan) !important;
  color: var(--neon-cyan) !important;
  background: rgba(0, 243, 255, 0.08) !important;
}

/* Кнопка очистки фильтров */
.btn-clear-filters {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--neon-magenta);
  color: var(--neon-magenta);
  height: 48px;
  padding: 0 16px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-clear-filters:hover {
  background: rgba(255, 0, 127, 0.15);
  box-shadow: 0 0 8px var(--neon-magenta-glow);
}

.btn-clear-filters i {
  width: 12px;
  height: 12px;
}

@media (max-width: 480px) {
  .btn-clear-filters {
    margin-left: auto; /* Выравнивание по правому краю во втором ряду */
  }
}

@keyframes slideDownPanel {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.tools-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tools-section h3 {
  font-family: 'Tilda Sans VF', sans-serif;
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 1.5px;
  margin-bottom: 4px;
  border-left: 2px solid var(--neon-cyan);
  padding-left: 6px;
}

.tools-row {
  display: flex;
  gap: 12px;
}

.tools-row .input-group {
  flex: 1;
  margin-bottom: 0;
}

.tools-grid-inputs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 480px) {
  .tools-grid-inputs {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .tools-grid-inputs {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tools-grid-inputs .input-group {
  margin-bottom: 0;
}

/* Компактный селектор */
.cyber-select-small {
  width: 100%;
  height: 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-neon);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.8rem;
  padding: 0 8px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cyber-select-small:focus {
  border-color: var(--border-neon-active);
  box-shadow: 0 0 6px var(--neon-cyan-glow);
}

.cyber-select-small option {
  background: #0f111a;
  color: var(--text-primary);
}

/* ==========================================================================
   SCROLLABLE PROJECTS TABLE LAYOUT
   ========================================================================== */
.table-container-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.table-scroll-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.7;
  padding-left: 24px;
  padding-right: 24px;
}

.table-scroll-hint i {
  animation: bounceX 1.5s infinite ease-in-out;
}

@keyframes bounceX {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--border-neon);
  border-left: none;
  border-right: none;
  border-radius: 0;
  background: var(--bg-card);
  max-height: 60vh;
  max-height: 60dvh;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 243, 255, 0.2) rgba(7, 8, 12, 0.5);
}

.table-wrapper::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: rgba(7, 8, 12, 0.5);
  border-radius: 12px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(0, 243, 255, 0.3);
  border-radius: 12px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 243, 255, 0.6);
}

/* Стили таблицы */
.cyber-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8rem;
  min-width: 1200px;
}

.cyber-table th {
  background: rgba(10, 12, 20, 0.95);
  color: var(--neon-cyan);
  font-family: 'Tilda Sans VF', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 14px 16px;
  border-bottom: 2px solid var(--border-neon);
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}

.cyber-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  vertical-align: middle;
  white-space: nowrap;
}

.cyber-table tbody tr {
  transition: background-color 0.2s ease;
}

.cyber-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.cyber-table tbody tr:hover {
  background: rgba(0, 243, 255, 0.05);
}

/* Специфические стили колонок */
.cyber-table td.cell-date {
  font-weight: 500;
  white-space: nowrap;
}

.cyber-table td.cell-project-name {
  font-family: 'Tilda Sans VF', sans-serif;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
}

.cyber-table td.cell-customer,
.cyber-table td.cell-partner {
  color: #d1d1d1;
}

.cyber-table td.cell-city {
  color: var(--neon-cyan);
  font-weight: 500;
}

.cyber-table td.cell-target-date {
  color: var(--neon-magenta);
  font-weight: 500;
  white-space: nowrap;
}

.cyber-table td.cell-kam {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.cyber-table td.cell-comments {
  color: var(--text-secondary);
  opacity: 0.8;
  font-style: italic;
  max-width: 300px;
  min-width: 180px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Оборудование внутри таблицы */
.table-eq-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: max-content;
}

.eq-tag {
  background: rgba(0, 243, 255, 0.08);
  border: 1px solid rgba(0, 243, 255, 0.2);
  color: var(--neon-cyan);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
}

.eq-tag-qty {
  background: rgba(0, 243, 255, 0.2);
  color: var(--text-primary);
  padding: 0 3px;
  border-radius: 3px;
  font-size: 0.65rem;
}

/* Пустое состояние */
.projects-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  gap: 12px;
}

.projects-empty-icon {
  width: 48px;
  height: 48px;
  color: var(--border-neon);
  margin-bottom: 8px;
  animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0px transparent); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 8px var(--neon-cyan-glow)); }
}

.projects-empty h2 {
  font-family: 'Tilda Sans VF', sans-serif;
  color: var(--text-primary);
  font-size: 1.2rem;
  margin: 0;
  letter-spacing: 1px;
}

.projects-empty p {
  font-size: 0.9rem;
  max-width: 320px;
  margin: 0;
}

/* ==========================================================================
   PROJECT MODAL & FORM STYLES
   ========================================================================== */
.project-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 5, 8, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-neon);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  z-index: 2;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  max-height: 90dvh;
  animation: modalScaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 12px;
}

.modal-title-group h2 {
  font-family: 'Tilda Sans VF', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.modal-meta-text {
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.3s ease;
}
.btn-close-modal:hover {
  color: var(--neon-red);
}
.btn-close-modal i {
  width: 20px;
  height: 20px;
}

.project-form {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Кастомный скроллбар формы */
.project-form::-webkit-scrollbar {
  width: 4px;
}
.project-form::-webkit-scrollbar-track {
  background: transparent;
}
.project-form::-webkit-scrollbar-thumb {
  background: rgba(0, 243, 255, 0.1);
  border-radius: 10px;
}
.project-form::-webkit-scrollbar-thumb:hover {
  background: var(--neon-cyan);
}

/* Оформление Select-поля */
.cyber-select {
  width: 100%;
  height: 50px;
  background-color: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0 16px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238e9cae' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px;
}

.cyber-select:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.15);
}

.cyber-select option {
  background-color: var(--bg-dark);
  color: var(--text-primary);
}

/* Динамические строки оборудования */
.equipment-section {
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(10, 12, 18, 0.35);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Tilda Sans VF', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.btn-text-action {
  background: transparent;
  border: none;
  color: var(--neon-cyan);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: color 0.3s ease;
}
.btn-text-action:hover {
  color: #ffffff;
  text-shadow: 0 0 5px var(--neon-cyan-glow);
}

.equipment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.equipment-row {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: rowFadeIn 0.3s ease;
}

@keyframes rowFadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-delete-row {
  background: rgba(255, 51, 51, 0.05);
  border: 1px solid rgba(255, 51, 51, 0.2);
  color: var(--neon-red);
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.btn-delete-row:hover {
  background: rgba(255, 51, 51, 0.15);
  border-color: var(--neon-red);
  box-shadow: 0 0 10px var(--neon-red-glow);
}

.btn-delete-row:disabled, .btn-delete-row.hidden {
  opacity: 0;
  pointer-events: none;
  width: 0;
  padding: 0;
  margin: 0;
  border: none;
}

.btn-delete-row i {
  width: 18px;
  height: 18px;
}

/* Стилизация textarea */
.project-form textarea {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: all 0.3s ease;
  resize: none;
}

.project-form textarea:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.15);
}

/* Формы кнопок действий */
.form-actions {
  display: flex;
  gap: 12px;
}

.btn-cancel {
  flex: 1;
  height: 52px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: var(--text-secondary);
  font-family: 'Tilda Sans VF', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* ==========================================================================
   PLACEHOLDERS & EMBEDDED VIEWS
   ========================================================================== */
.placeholder-module {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(10, 12, 18, 0.2);
}

.placeholder-icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 20px;
  animation: pulse-placeholder 2s infinite ease-in-out;
}

@keyframes pulse-placeholder {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

.placeholder-module h2 {
  font-family: 'Tilda Sans VF', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 2px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.placeholder-module p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  max-width: 280px;
  line-height: 1.5;
}

/* Ограничение доступа */
.access-denied-message {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  border: 1px solid rgba(255, 51, 51, 0.15);
  background: rgba(255, 51, 51, 0.02);
  border-radius: 20px;
}

.denied-icon {
  width: 48px;
  height: 48px;
  color: var(--neon-red);
  filter: drop-shadow(0 0 8px var(--neon-red-glow));
  margin-bottom: 20px;
}

.access-denied-message h2 {
  font-family: 'Tilda Sans VF', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 2px;
  margin-bottom: 8px;
  color: var(--neon-red);
  text-shadow: 0 0 5px var(--neon-red-glow);
}

.access-denied-message p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  max-width: 260px;
  line-height: 1.5;
}

/* Встроенная админ-панель */
#admin-panel-embedded {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   ADMIN PANEL EMBEDDED CUSTOM STYLES
   ========================================================================== */

/* Переключатель вкладок администратора */
.admin-tabs {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.admin-tab-btn {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 10px 16px;
  font-family: 'Tilda Sans VF', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.admin-tab-btn:hover {
  background: rgba(0, 243, 255, 0.05);
  color: var(--text-primary);
  border-color: rgba(0, 243, 255, 0.2);
}

.admin-tab-btn.active {
  background: rgba(0, 243, 255, 0.08);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.15);
}

/* Подразделы настроек */
.admin-sub-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  animation: formFadeIn 0.3s ease forwards;
}

.admin-sub-panel.active {
  display: flex;
}

/* Кнопка редактирования в списке */
.btn-edit {
  background: rgba(0, 243, 255, 0.05);
  border: 1px solid rgba(0, 243, 255, 0.2);
  color: var(--neon-cyan);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.btn-edit i { width: 15px; height: 15px; }

.btn-edit:active {
  background: rgba(0, 243, 255, 0.15);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan-glow);
  transform: scale(0.92);
}

/* Кнопки действий в строке списка */
.item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.admin-add-form {
  margin-bottom: 20px;
}

.add-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.btn-add {
  height: 52px;
  width: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #00b894 0%, #39ff14 100%);
  border: none;
  border-radius: 14px;
  color: #000000;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(57, 255, 20, 0.25);
  transition: all 0.3s ease;
}

.btn-add i {
  width: 22px;
  height: 22px;
  stroke-width: 2.5px;
}

.btn-add:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(57, 255, 20, 0.15);
}

.whitelist-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Tilda Sans VF', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 1px;
  margin-bottom: 10px;
  padding: 0 4px;
}

.badge-count {
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid var(--border-neon);
  color: var(--neon-cyan);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
}

.list-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  border-radius: 12px;
  background: rgba(10, 12, 18, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.whitelist-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
}

.whitelist-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px 14px;
  gap: 10px;
  transition: all 0.3s ease;
}

.whitelist-item:hover {
  background: rgba(0, 243, 255, 0.02);
  border-color: rgba(0, 243, 255, 0.1);
}

.item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.item-email {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-admin {
  align-self: flex-start;
  font-family: 'Tilda Sans VF', sans-serif;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--neon-magenta);
  border: 1px solid rgba(255, 0, 127, 0.2);
  background: rgba(255, 0, 127, 0.05);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 4px var(--neon-magenta-glow);
}

.badge-head {
  align-self: flex-start;
  font-family: 'Tilda Sans VF', sans-serif;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 243, 255, 0.2);
  background: rgba(0, 243, 255, 0.05);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 4px var(--neon-cyan-glow);
}

.badge-kam {
  align-self: flex-start;
  font-family: 'Tilda Sans VF', sans-serif;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--neon-green);
  border: 1px solid rgba(57, 255, 20, 0.2);
  background: rgba(57, 255, 20, 0.05);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 4px var(--neon-green-glow);
}

.badge-pm {
  align-self: flex-start;
  font-family: 'Tilda Sans VF', sans-serif;
  font-size: 0.55rem;
  font-weight: 700;
  color: #ffdf00;
  border: 1px solid rgba(255, 223, 0, 0.2);
  background: rgba(255, 223, 0, 0.05);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 4px rgba(255, 223, 0, 0.4);
}

.badge-psm {
  align-self: flex-start;
  font-family: 'Tilda Sans VF', sans-serif;
  font-size: 0.55rem;
  font-weight: 700;
  color: #b967ff;
  border: 1px solid rgba(185, 103, 255, 0.2);
  background: rgba(185, 103, 255, 0.05);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 4px rgba(185, 103, 255, 0.4);
}

.badge-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  outline: none;
  text-align: center;
  font-family: 'Tilda Sans VF', sans-serif;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 1px 18px 1px 6px;
  border-radius: 4px;
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 8px;
  transition: all 0.2s ease;
}

.badge-select:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.1);
}

.badge-select.badge-admin {
  background-image: url("data:image/svg+xml;utf8,<svg fill='rgb(255,0,127)' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
}

.badge-select.badge-head {
  background-image: url("data:image/svg+xml;utf8,<svg fill='rgb(0,243,255)' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
}

.badge-select.badge-kam {
  background-image: url("data:image/svg+xml;utf8,<svg fill='rgb(57,255,20)' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
}

.badge-select.badge-pm {
  background-image: url("data:image/svg+xml;utf8,<svg fill='rgb(255,223,0)' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
}

.badge-select.badge-psm {
  background-image: url("data:image/svg+xml;utf8,<svg fill='rgb(185,103,255)' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
}

.badge-select option {
  background-color: #0f111a;
  color: var(--text-primary);
  font-family: sans-serif;
  font-size: 0.75rem;
}


.btn-delete {
  background: rgba(255, 51, 51, 0.05);
  border: 1px solid rgba(255, 51, 51, 0.2);
  color: var(--neon-red);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.btn-delete i { width: 15px; height: 15px; }

.btn-delete:active {
  background: rgba(255, 51, 51, 0.2);
  border-color: var(--neon-red);
  box-shadow: 0 0 10px var(--neon-red-glow);
  transform: scale(0.92);
}

.item-fade-out {
  opacity: 0;
  transform: scale(0.9) translateX(-20px);
  transition: all 0.4s ease;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.app-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(10, 12, 18, 0.9);
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 20;
}

.system-logs {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-family: monospace;
  font-size: 0.7rem;
}

.log-label {
  color: var(--neon-cyan);
  font-weight: 700;
  line-height: 1.3;
}

.log-message {
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.3;
  width: 100%;
}

.copyright {
  text-align: center;
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes pulse-neon {
  0%, 100% {
    filter: drop-shadow(0 0 4px var(--neon-cyan-glow));
    opacity: 0.9;
  }
  50% {
    filter: drop-shadow(0 0 12px var(--neon-cyan));
    opacity: 1;
  }
}

/* Адаптивность под компактные экраны */
@media (max-height: 600px) {
  .app-header {
    height: 52px;
  }
  .card-header, .panel-header {
    margin-bottom: 10px;
  }
  .auth-card {
    padding: 16px;
  }
  .auth-form {
    gap: 10px;
  }
  .input-wrapper input, .cyber-select {
    height: 44px;
  }
  .btn-submit, .btn-add {
    height: 44px;
  }
  .btn-add {
    width: 44px;
  }
  .list-scroll-area {
    max-height: 160px;
  }
  .cyber-title {
    font-size: 1.8rem;
  }
  .system-status-panel {
    margin-top: 15px;
  }
  .modal-card {
    padding: 16px;
    max-height: 95vh;
  }
}

@media (orientation: landscape) {
  .app-container {
    max-width: 100%;
  }
}

/* Адаптивность шапки под узкие экраны (обрезка поиска/иконок) */
@media (max-width: 420px) {
  .app-header {
    padding: 0 12px;
  }
  .header-controls {
    gap: 6px;
  }
  .search-wrapper {
    margin-right: 6px !important;
  }
  .global-search {
    width: 84px;
  }
  .global-search:focus {
    width: 130px;
  }
  .btn-notify,
  .server-status-btn,
  .btn-logout {
    width: 30px;
    height: 30px;
  }
  .brand-text {
    font-size: 0.85rem;
  }
  .cyber-title-wrapper {
    padding-left: 52px;
  }
}

/* ==========================================================================
   CHOICES.JS CYBERPUNK CUSTOMIZATION
   ========================================================================== */
.choices {
  margin-bottom: 0;
  font-family: inherit;
  width: 100% !important;
}

/* Скрываем нативный select, который дублируется поверх Choices.js на мобильных устройствах */
.choices select,
.choices__inner select,
select.choices-fallback,
.choices [data-type*="select-one"] select {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
}

.choices__inner {
  background-color: var(--bg-input) !important;
  border: 1px solid var(--border-neon) !important;
  border-radius: 14px !important;
  min-height: 48px !important;
  padding: 8px 16px !important;
  color: var(--text-primary) !important;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  position: relative;
}

.choices.is-focused .choices__inner {
  border-color: var(--neon-cyan) !important;
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.15) !important;
}

.choices__list--single {
  padding: 0 !important;
  color: var(--text-primary) !important;
  font-size: 0.95rem;
}

.choices__list--dropdown {
  background-color: var(--bg-dark) !important;
  border: 1px solid var(--border-neon) !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 243, 255, 0.15) !important;
  z-index: 1000 !important;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
  background-color: rgba(0, 243, 255, 0.1) !important;
  color: var(--neon-cyan) !important;
}

.choices__list--dropdown .choices__item {
  padding: 10px 16px !important;
  font-size: 0.9rem !important;
}

.choices__input {
  background-color: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px !important;
  color: var(--text-primary) !important;
  padding: 8px 12px !important;
  font-size: 0.85rem !important;
}

.choices__input:focus {
  border-color: var(--neon-cyan) !important;
}

.choices__inner .choices__input {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
  height: auto !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: relative !important;
  color: var(--text-primary) !important;
}

/* Если уже выбраны исполнители, сворачиваем поле поиска, чтобы не мешалось */
.choices[data-type*="select-multiple"] .choices__item ~ input.choices__input {
  width: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.choices[data-type*="select-multiple"] .choices__item ~ input.choices__input::placeholder {
  color: transparent !important;
}


.choices[data-type*="select-one"]::after,
.choices[data-type*="select-multiple"]::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border-color: var(--text-secondary) transparent transparent transparent !important;
  border-style: solid;
  border-width: 6px 5px 0 5px !important;
  right: 18px !important;
  pointer-events: none !important;
}

.choices[data-type*="select-one"].is-open::after,
.choices[data-type*="select-multiple"].is-open::after {
  border-color: transparent transparent var(--neon-cyan) transparent !important;
  border-width: 0 5px 6px 5px !important;
}

/* Компактные бейджи для множественного выбора (Исполнители) */
.choices[data-type*="select-multiple"] .choices__list--multiple .choices__item {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border-neon) !important;
  border-radius: 6px !important;
  color: var(--text-primary) !important;
  padding: 4px 8px !important;
  margin-right: 6px !important;
  margin-bottom: 4px !important;
  font-size: 0.85rem !important;
  display: inline-flex !important;
  align-items: center !important;
}

.choices[data-type*="select-multiple"] .choices__button {
  border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
  margin-left: 6px !important;
  padding-left: 6px !important;
  background-image: none !important; /* Убираем стандартную иконку, если есть */
  color: var(--text-muted) !important;
  opacity: 1 !important;
}
.choices[data-type*="select-multiple"] .choices__button:hover {
  color: var(--neon-red) !important;
}

/* Компактный стиль для строк оборудования */
.equipment-row .choices__inner {
  min-height: 38px !important;
  border-radius: 6px !important;
  padding: 4px 12px !important;
}

.equipment-row .choices__list--single {
  font-size: 0.85rem;
}

/* =========================================
   МОДУЛЬ "ЗАДАЧИ" (KANBAN + LIST)
   ========================================= */

.tasks-view-container {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.tasks-view-container.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Kanban Board */
.kanban-board {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 10px;
  align-items: flex-start;
}

.kanban-column {
  flex: 0 0 300px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-neon);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.kanban-column-header {
  padding: 15px;
  border-bottom: 1px solid var(--border-neon);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-column-header h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.kanban-column-header .task-count {
  background: var(--bg-dark);
  color: var(--neon-cyan);
  border: 1px solid var(--neon-cyan);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.8rem;
  font-weight: bold;
}

.kanban-column-body {
  padding: 15px 15px 25px 15px;
  max-height: calc(100vh - 270px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Kanban Card */
.task-card {
  background: var(--bg-darker);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 8px;
  padding: 12px;
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.task-card:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
  transform: translateY(-2px);
}

.task-card:active {
  cursor: grabbing;
}

.task-card.dragging {
  opacity: 0.5;
  border: 2px dashed var(--neon-cyan);
}

.task-card-title {
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.task-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-card-project {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.task-card-deadline {
  color: #ff9999;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Priority Badges */
.priority-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
}

.priority-high {
  background: rgba(255, 0, 128, 0.2);
  color: var(--neon-magenta);
  border: 1px solid var(--neon-magenta);
}

.priority-medium {
  background: rgba(255, 255, 0, 0.1);
  color: #ffff00;
  border: 1px solid #ffff00;
}

.priority-low {
  background: rgba(0, 255, 255, 0.1);
  color: var(--neon-cyan);
  border: 1px solid var(--neon-cyan);
}

/* Drop Target Highlight */
.kanban-column-body.drag-over {
  background: rgba(0, 255, 255, 0.05);
}
.kanban-column-body.drag-over .task-card {
  pointer-events: none;
}

/* Желтый цвет для стран СНГ в выпадающих списках */
.choices__item[data-value="Кыргызстан"],
.choices__item[data-value="Таджикистан"],
.choices__item[data-value="Туркменистан"],
.choices__item[data-value="Монголия"] {
  color: #ffff00 !important;
}

select option[value="Кыргызстан"],
select option[value="Таджикистан"],
select option[value="Туркменистан"],
select option[value="Монголия"] {
  color: #ffff00 !important;
}

/* ==========================================================================
   МОДУЛЬ ПИСЬМА (ГЕНЕРАТОР)
   ========================================================================== */
.letters-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  min-height: 400px;
}

.letters-step { display: none; }
.letters-step.active { display: block; }

.letters-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.letters-section-title h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 2px;
}

/* Сетка карточек шаблонов */
.letters-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.letter-template-card {
  background: var(--bg-card);
  border: 1px solid var(--border-neon);
  border-radius: 16px;
  padding: 24px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.letter-template-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.letter-template-card:hover {
  border-color: var(--neon-cyan);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 243, 255, 0.08);
}
.letter-template-card:hover::before { opacity: 1; }

.ltc-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  border: 1px solid;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.ltc-icon i { width: 22px; height: 22px; }

.letter-template-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: 0.5px;
}

.letter-template-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0 0 14px;
}

.ltc-tags {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.ltc-tags span {
  background: rgba(0, 243, 255, 0.08);
  border: 1px solid rgba(0, 243, 255, 0.15);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--neon-cyan);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Двухколоночный layout: форма + preview */
.letters-fill-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 20px;
  min-height: 600px;
}

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

.letters-form-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-neon);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  max-height: 80vh;
}

.letters-form-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* OCR зона */
.letters-ocr-zone {
  border: 2px dashed rgba(0, 243, 255, 0.2);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 16px;
  background: rgba(0, 243, 255, 0.02);
}

.letters-ocr-zone:hover,
.letters-ocr-zone.drag-over {
  border-color: var(--neon-cyan);
  background: rgba(0, 243, 255, 0.06);
  box-shadow: 0 0 16px rgba(0, 243, 255, 0.08);
}

/* Предпросмотр */
.letters-preview-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-neon);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.letters-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.letters-preview-scroll {
  flex: 1;
  overflow-y: auto;
  max-height: 72vh;
}

.letter-preview-page {
  background: #ffffff;
  color: #000;
  border-radius: 4px;
  padding: 40px 36px;
  font-family: 'Times New Roman', Times, serif;
  font-size: 11px;
  line-height: 1.5;
  min-height: 700px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.letter-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
}

/* Samsung letterhead inside preview */
.lp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  border-bottom: 2px solid #1428a0;
  padding-bottom: 12px;
}

.lp-logo {
  font-family: Arial, sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: #1428a0;
  letter-spacing: 4px;
}

.lp-address {
  font-size: 8px;
  color: #444;
  line-height: 1.5;
  text-align: left;
}

.lp-body-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}

.lp-col { font-size: 10.5px; line-height: 1.55; }
.lp-col-en { }
.lp-col-ru { }

.lp-title {
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.lp-to {
  font-weight: 700;
  font-size: 11px;
  text-align: center;
  margin-bottom: 14px;
}

.lp-date {
  color: #cc0000;
  font-weight: 700;
  font-style: italic;
  font-size: 10px;
  margin-bottom: 14px;
}

.lp-signatory {
  margin-top: 40px;
  text-align: center;
  border-top: 1px solid #888;
  padding-top: 8px;
}

.lp-signatory-name {
  font-weight: 700;
  font-size: 11px;
  color: #1428a0;
}

.lp-signatory-position {
  font-size: 9.5px;
  color: #333;
}

.lp-highlight {
  font-weight: 700;
}

/* Печать */
@media print {
  body * { visibility: hidden; }
  .letter-preview-page, .letter-preview-page * { visibility: visible; }
  .letter-preview-page {
    position: absolute;
    left: 0; top: 0;
    width: 210mm;
    padding: 20mm;
    box-shadow: none;
  }
}

/* Choices.js Cyber Theme Styles */
.choices {
  margin-bottom: 0;
  font-family: inherit;
}
.choices__inner {
  background-color: var(--bg-input) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  padding: 8px 12px !important;
  color: var(--text-primary) !important;
  min-height: 50px !important;
}
.choices__inner:focus, .choices.is-focused .choices__inner {
  border-color: var(--neon-cyan) !important;
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.15) !important;
}
.choices__list--dropdown {
  background-color: var(--bg-dark) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 12px !important;
  z-index: 100 !important;
}
.choices__list--dropdown .choices__item--selectable.is-highlighted {
  background-color: rgba(0, 243, 255, 0.15) !important;
  color: var(--neon-cyan) !important;
}
.choices__item {
  font-size: 0.85rem !important;
}
.choices__item--selectable {
  color: var(--text-primary) !important;
}
.choices__list--multiple .choices__item {
  background-color: rgba(0, 243, 255, 0.15) !important;
  border: 1px solid var(--neon-cyan) !important;
  border-radius: 6px !important;
  color: var(--text-primary) !important;
  font-size: 0.8rem !important;
}
.choices__list--multiple .choices__item .choices__button {
  border-left: 1px solid rgba(0, 243, 255, 0.3) !important;
}
.choices__input {
  background-color: transparent !important;
  color: var(--text-primary) !important;
  font-size: 0.85rem !important;
}

