:root{
    --bg:#f8fafc;        /* общий фон */
    --surface:#ffffff;   /* карточки/панели */
    --text:#0f172a;      /* основной текст */
    --muted:#64748b;     /* вторичный текст */
    --primary:#2563eb;   /* акцент (кнопки, ссылки) */
    --primary-hover:#1d4ed8;
    --danger:#ef4444;
    --success:#10b981;
    --border:#e5e7eb;    /* границы/разделители */
    --shadow:0 6px 24px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
    --surface-hover:#f3f4f6; /* наведение по умолчанию */
  }

  /* Улучшенная тёмная тема */
  body.dark{
    --bg:#0a0e1a;
    --surface:#111827;
    --text:#f1f5f9;
    --muted:#94a3b8;
    --primary:#3b82f6;
    --primary-hover:#2563eb;
    --danger:#f87171;
    --success:#34d399;
    --border:#1e293b;
    --shadow:0 6px 24px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.2);
    --surface-hover:#1e293b;
    background:var(--bg);
    color:var(--text);
  }
  
  *{box-sizing:border-box}
  html{height:100%; font-size:50%}
  body{
    height:100%; margin:0; background:var(--bg); color:var(--text);
    font:16px/1.55 Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, Apple Color Emoji, Segoe UI Emoji;
    transition: background-color 0.3s ease, color 0.3s ease;
  }
  
  /* Плавные переходы для всех элементов */
  *{transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;}
  
  /* Шапка */
  .topbar{background:var(--surface); border-bottom:1px solid var(--border); position:sticky; top:0; z-index:10}
  .topbar .container{display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 24px; max-width:1000px; margin:0 auto}
  .topbar .actions{display:flex; align-items:center; gap:8px}
  .brand{color:var(--text); text-decoration:none; font-weight:700; letter-spacing:.2px}
  .link{background:none; border:1px solid var(--border); padding:8px 12px; border-radius:10px; color:var(--text); cursor:pointer}
  .link:hover{background:var(--surface-hover)}
  
  /* Контейнер */
  .container{max-width:1000px; margin:0 auto; padding:24px}
  
  /* Заголовки и карточки форм */
  h1{margin:16px 0 12px; letter-spacing:.2px}
  .card{
    display:grid; gap:12px; background:var(--surface); padding:20px;
    border-radius:14px; border:1px solid var(--border); box-shadow:var(--shadow); max-width:480px
  }
  .card input, textarea, input[type=file]{
    width:100%; padding:12px 12px; border-radius:10px; border:1px solid var(--border);
    background:var(--surface); color:var(--text); outline:none; transition:border-color .2s, box-shadow .2s
  }
  .card input:focus, textarea:focus{border-color:var(--primary); box-shadow:0 0 0 3px rgba(37,99,235,.12)}
  button{padding:10px 14px; border:none; border-radius:10px; background:var(--primary); color:#fff; cursor:pointer; font-weight:600}
  button:hover{filter:brightness(.96)}
  button.danger{background:var(--danger)}
  .error{color:#dc2626}
  .muted{color:var(--muted)}
  
  /* Лента сообщений */
  #messages{max-height:calc(100vh - 220px); overflow:auto; padding-right:4px}
  .messages{display:flex; flex-direction:column; gap:12px; margin:12px 0 16px}
  .msg{display:flex}
  .msg.you{justify-content:flex-end}
  
  .bubble{
    max-width:70%; padding:12px 14px; border-radius:14px; background:var(--surface);
    border:1px solid var(--border); box-shadow:var(--shadow)
  }
  .msg.you .bubble{
    background:var(--primary); border-color:transparent; color:#fff;
    box-shadow:0 8px 24px rgba(37,99,235,.18), 0 1px 2px rgba(0,0,0,.05)
  }
  .meta{display:flex; gap:8px; color:var(--muted); font-size:12px; margin-bottom:6px}
  .msg.you .meta{color:rgba(255,255,255,.8)}
  .text{white-space:pre-wrap}
  
  /* Вложения в сообщениях */
  .files{display:flex; flex-wrap:wrap; gap:10px; margin-top:8px}
  .file-item{
    display:flex; align-items:center; gap:8px; padding:8px 10px; border:1px solid var(--border);
    border-radius:12px; background:var(--bg); text-decoration:none; color:var(--text)
  }
  .file-item:hover{background:var(--surface-hover)}
  .file-item.doc .icon{font-size:18px}
  .file-item.image{padding:6px}
  .file-item.image img{width:140px; height:92px; object-fit:cover; border-radius:10px; border:1px solid var(--border)}
  .file-item .name{max-width:260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
  .file-item .meta{color:var(--muted); font-size:12px}
  .file-item.audio{gap:10px}
  .file-item.audio .name{max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
  
  /* Компонент ввода (нижняя панель) */
  .composer{
    position:sticky; bottom:0; background:var(--surface); border:1px solid var(--border);
    border-radius:16px; padding:14px; box-shadow:var(--shadow); display:grid; gap:12px; margin-bottom:12px
  }
  .attachments-row{display:flex; align-items:center; gap:10px; flex-wrap:wrap}
  .previews{display:flex; gap:8px; flex-wrap:wrap}
  .preview{
    display:flex; align-items:center; gap:8px; background:var(--bg); border:1px dashed var(--border);
    padding:6px 8px; border-radius:10px; position:relative
  }
  .preview-img{width:64px; height:48px; object-fit:cover; border-radius:8px; border:1px solid var(--border)}
  .preview-icon{font-size:18px}
  .preview-name{max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#334155}
  .preview-remove{
    position:absolute; top:-7px; right:-7px; width:22px; height:22px; border-radius:50%;
    border:1px solid var(--border); background:var(--surface); color:var(--text); cursor:pointer
  }
  .actions{display:flex; gap:10px}
  .btn{padding:10px 14px; border-radius:10px; background:var(--surface-hover); border:1px solid var(--border); color:var(--text); cursor:pointer}
  .btn.primary{background:var(--primary); border-color:transparent; color:#fff}
  .btn[disabled]{opacity:.6; cursor:not-allowed}
  #send-form.dragging{outline:2px dashed var(--primary); outline-offset:8px}
  
  /* Прогресс загрузки */
  .upload-progress{display:grid; gap:6px; background:var(--bg); border:1px solid var(--border); border-radius:12px; padding:10px}
  .up-head{display:flex; justify-content:space-between; align-items:center}
  .up-bar{height:8px; background:#e5e7eb; border:1px solid var(--border); border-radius:999px; overflow:hidden}
  .up-fill{height:100%; width:0%; background:var(--primary)}


  /* Input bar: скрепка слева, круглая кнопка отправки справа */
.input-bar{
    display:grid;
    grid-template-columns: 44px 1fr 44px;
    align-items:center;
    gap:8px;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:999px;
    padding:6px 8px;
    box-shadow: var(--shadow);
  }
  
  .input-bar textarea{
    border:none;
    outline:none;
    resize:none;
    background:transparent;
    padding:10px 4px;
    font-size:15px;
    line-height:1.35;
    max-height:140px;
    overflow:auto;
  }
  
  .icon-btn{
    width:40px; height:40px;
    border:none; border-radius:50%;
    display:inline-flex; align-items:center; justify-content:center;
    background:var(--surface-hover); /* slate-100 */
    color:var(--muted);      /* slate-600 */
    cursor:pointer;
    transition: transform .08s ease, background .2s ease, color .2s ease;
  }
  .icon-btn:hover{ background:var(--border); color:var(--text) }
  .icon-btn:active{ transform: scale(.97) }
  .icon-btn[disabled]{ opacity:.6; cursor:not-allowed }
  
  .icon-btn.attach { background:var(--surface-hover); color:var(--primary) }       /* немного выделим скрепку */
  .icon-btn.attach:hover { background:var(--border) }
  
  .icon-btn.send.primary{
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 24px rgba(37,99,235,.25), 0 1px 2px rgba(0,0,0,.06);
  }
  .icon-btn.send.primary:hover{ filter:brightness(.96) }
  .icon-btn.send.primary svg{ stroke: currentColor }
  
  /* Превью под полем — компактнее */
  .previews{ margin-top:8px }
  
  /* сетка изображений */
.files-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px;margin-top:6px}
.file-item.image{padding:0;border:none;background:transparent}
.file-item.image img{width:100%;height:120px;object-fit:cover;border-radius:10px;border:1px solid var(--border)}

/* аудио/документы */
.file-item.audio{display:flex;align-items:center;gap:10px;border:1px solid var(--border);border-radius:12px;background:var(--bg);padding:8px 10px;margin-top:8px}
.file-item.audio audio{width:240px}
.file-item.doc{display:flex;align-items:center;gap:10px;margin-top:8px}
.file-item.doc .icon{min-width:32px;height:32px;border-radius:8px;background:#eef2ff;color:#1e40af;display:inline-flex;align-items:center;justify-content:center;font-weight:700}
.file-item .name{max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file-item .meta{color:var(--muted);font-size:12px}
/* Карточка чата: бордер, тень, фиксированная высота, 2 ряда (лента + ввод) */
.chat-card{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 12px;
    margin: 8px auto 16px;
    max-width: 880px;
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 10px;
    /* Влезает «в экран»: регулируй при желании */
    height: min(78vh, 720px);
  }
  
  .analysis-progress{
    width:100%;
    display:flex;
    flex-direction:column;
    gap:6px;
    margin-bottom:6px;
  }
  .analysis-progress.hidden{display:none;}
  .analysis-progress-label{
    font-size:13px;
    color:var(--muted);
    font-weight:500;
  }
  .analysis-progress-track{
    position:relative;
    height:6px;
    border-radius:999px;
    background:rgba(37,99,235,.12);
    overflow:hidden;
  }
  .analysis-progress-fill{
    position:absolute;
    inset:0;
    width:0%;
    background:linear-gradient(90deg,var(--primary),var(--primary-hover));
    transition:width .4s ease;
  }

  /* Лента внутри карточки — внутренний скролл, компактнее отступы */
  .chat-card #messages{
    max-height: unset;      /* сбрасываем старое правило */
    height: 100%;
    overflow: auto;
    padding: 4px 6px 6px 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
  }
  
  /* Плотность и размер бабблов */
  .chat-card .messages{ gap: 8px; margin: 6px 0 8px; }
  .chat-card .bubble{
    max-width: 64%;
    padding: 10px 12px;
    border-radius: 12px;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
    animation: msgIn .22s ease both;
  }
  .chat-card .msg.you .bubble{ box-shadow: 0 6px 18px rgba(37,99,235,.18), 0 1px 2px rgba(0,0,0,.04); }
  .chat-card .msg.bot .bubble{ background:var(--surface); }
  .chat-card .bubble:hover{ transform: translateY(-1px); }
  
  /* Метаданные — компактнее */
  .chat-card .meta{ margin-bottom: 4px; font-size: 11.5px; }
  
  /* Компактные карточки вложений */
  .chat-card .files{ gap:8px; margin-top:6px; }
  .chat-card .file-item{ padding:6px 8px; border-radius:10px; }
  .chat-card .file-item.image img{ height:100px; }
  
  /* Компонент ввода — плотно и внутри карточки */
  .chat-card .composer{
    margin: 0;
    padding: 10px;
    border-radius: 12px;
    box-shadow: none;
    background: var(--surface);
  }
  .chat-card .input-bar{
    grid-template-columns: 40px 1fr 40px;
    padding: 4px 6px;
  }
  .chat-card .icon-btn{ width: 36px; height: 36px; }
  
  /* Индикатор загрузки — компакт */
  .chat-card .upload-progress{ padding:8px; border-radius:10px; }
  .chat-card .up-bar{ height:6px; }
  
  /* Разделители дат — маленькие чипы */
  .date-sep{
    align-self:center;
    background:#eef2ff;
    color:#334155;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11.5px;
    margin: 6px 0;
  }
  
  /* Анимации */
  @keyframes msgIn{
    from{ opacity:0; transform: translateY(4px) scale(.995); }
    to{ opacity:1; transform: none; }
  }
  
  /* Уважим users с reduced motion */
  @media (prefers-reduced-motion: reduce){
    .chat-card .bubble{ animation: none; }
    .chat-card .bubble:hover{ transform:none; }
  }
  
  /* Небольшие экраны: растягиваем баббл до 80% и ниже высоту карточки */
  @media (max-width: 680px){
    .chat-card{ height: min(80vh, 640px); }
    .chat-card .bubble{ max-width: 80%; }
  }
  

  /* каркас карточки чата */
.chat-card { display:flex; flex-direction:column; height:70vh; }
.chat-scroll { flex:1; overflow:auto; padding:16px; background:var(--surface); }

.msg-row { display:flex; margin-bottom:10px; }
.msg-left { justify-content:flex-start; }
.msg-right { justify-content:flex-end; }
.msg-bubble {
  max-width: 640px;
  padding:12px 14px;
  border-radius:14px;
  box-shadow: var(--shadow);
  border:1px solid var(--border);
  background:var(--surface);
}
.msg-bubble.user { background:#2563eb; color:#fff; border-color:#1e40af; }
.msg-meta { font-size:12px; opacity:.7; margin-bottom:6px; display:flex; gap:8px; }
.msg-text { white-space:pre-wrap; line-height:1.45; }
.msg-files { margin-top:8px; display:grid; gap:6px; }
.file-pill { display:flex; align-items:center; gap:8px; background:var(--surface-hover); padding:8px; border-radius:10px; }
.file-pill a { color:var(--text); text-decoration:underline; }
.file-size { color:var(--muted); font-size:12px; margin-left:auto; }

/* композер */
.composer {
  display:flex; align-items:center; gap:10px;
  padding:10px; border-top:1px solid var(--border);
  background:var(--surface); position:sticky; bottom:0;
}
.composer textarea{
  flex:1; resize:none; border:1px solid var(--border); border-radius:12px;
  padding:10px 12px; min-height:42px; max-height:120px; outline:none;
}
.attach-btn, .send-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:38px; height:38px; border-radius:999px; border:1px solid var(--border);
  background:var(--surface); cursor:pointer; transition:.15s;
}
.attach-btn:hover, .send-btn:hover{ background:var(--bg); }
.send-btn{ background:#2563eb; color:#fff; border-color:#1e40af; }
.send-btn:hover{ filter:brightness(0.98); }

/* прогресс */
.progress{ position:relative; height:10px; background:var(--surface-hover); margin:10px; border-radius:8px; }
.progress .bar{ height:100%; background:#2563eb; border-radius:8px; transition:width .25s; }
.progress .label{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:12px; color:#334155;}
.hidden{ display:none; }
/* бейдж на скрепке */
.badge{
    position:absolute; top:-6px; right:-6px;
    min-width:18px; height:18px; padding:0 4px;
    background:#ef4444; color:#fff; border-radius:10px;
    font-size:11px; line-height:18px; text-align:center;
    border:2px solid var(--surface);
  }
  
  /* контейнер чипсов под композером */
  .chips{
    display:flex; flex-wrap:wrap; gap:8px;
    padding:10px; background:var(--surface); border-top:1px solid var(--border);
  }
  .chip{
    display:inline-flex; align-items:center; gap:8px;
    max-width: 100%;
    background:var(--surface-hover); border:1px solid var(--border);
    border-radius:999px; padding:6px 10px;
    font-size:13px;
  }
  .chip-name{ max-width:320px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .chip-size{ color:var(--muted); font-size:12px; }
  .chip-x{
    border:none; background:transparent; cursor:pointer;
    font-size:16px; line-height:1; color:var(--muted);
  }
  .chip-x:hover{ color:var(--text); }
  .btn-light{
    background:var(--surface-hover); border:1px solid var(--border);
    color:var(--text); padding:8px 12px; border-radius:8px;
  }
  .btn-block{ width:100%; }
  .topbar{ display:flex; align-items:center; justify-content:space-between; padding:12px 16px; border-bottom:1px solid var(--border); background:var(--surface); }
  .sidebar-footer{ margin-top:auto; padding:12px; border-top:1px solid var(--border); }
  
  /* Адаптивность для таблиц и карточек */
  @media (max-width: 768px) {
    .table table, .cards {
      display: block;
      overflow-x: auto;
      white-space: nowrap;
    }
    .cards {
      grid-template-columns: 1fr;
    }
    
    /* Улучшения для мобильного интерфейса */
    .container {
      padding: 16px;
    }
    
    .card {
      padding: 16px;
      max-width: 100%;
    }
    
    /* Адаптивные кнопки */
    button, .btn {
      min-height: 44px;
      padding: 12px 16px;
    }
    
    /* Улучшения для форм */
    input, textarea, select {
      min-height: 44px;
      font-size: 16px; /* Предотвращает зум на iOS */
    }
  }
  
  /* Дополнительные мобильные адаптации */
  @media (max-width: 480px) {
    .container {
      padding: 12px;
    }
    
    h1 {
      font-size: 24px;
    }
    
    .card {
      padding: 12px;
    }
  }
  
  /* Эффекты наведения и активные состояния для кнопок и ссылок */
  a:hover, a:focus {
    color: var(--primary);
    text-decoration: underline;
  }

  button:hover, button:focus {
    background-color: var(--primary);
    color: #fff;
    filter: brightness(0.95);
  }

  button:active {
    transform: scale(0.98);
  }

  .btn:hover, .btn:focus {
    background-color: var(--primary);
    color: #fff;
    filter: brightness(0.95);
  }

  .btn:active {
    transform: scale(0.98);
  }
  
  /* Настройки профиля */
.settings-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.settings-header {
  text-align: center;
  margin-bottom: 40px;
}

.settings-header h1 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 12px 0;
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.settings-subtitle {
  color: var(--muted);
  font-size: 18px;
  margin: 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.settings-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1), 0 2px 8px rgba(15, 23, 42, 0.06);
}

.settings-card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.settings-card-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.settings-card-icon svg {
  width: 24px;
  height: 24px;
}

.settings-card-header h2 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.settings-card-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
}

.form-group input {
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.2s ease;
  background: var(--surface);
  color: var(--text);
}

.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
  outline: none;
}

.form-group input:hover {
  border-color: #cbd5e1;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
}

/* Аватар */
.avatar-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.avatar-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.avatar-preview img,
.avatar-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--border);
  transition: all 0.3s ease;
}

.avatar-placeholder {
  background: var(--surface-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.avatar-placeholder svg {
  width: 48px;
  height: 48px;
}

.avatar-preview img:hover,
.avatar-placeholder:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

.avatar-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.file-upload {
  position: relative;
  width: 100%;
}

.file-upload input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.file-upload-label:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
}

.file-upload-label svg {
  width: 20px;
  height: 20px;
}

.avatar-info {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.avatar-info p {
  margin: 4px 0;
}

/* Интеграции placeholder */
.integrations-placeholder {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.placeholder-icon {
  width: 64px;
  height: 64px;
  background: var(--surface-hover);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--muted);
}

.placeholder-icon svg {
  width: 32px;
  height: 32px;
}

.integrations-placeholder h3 {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.integrations-placeholder p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Уведомления */
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.alert-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Адаптивность */
@media (max-width: 768px) {
  .settings-container {
    padding: 16px;
  }
  
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .settings-card {
    padding: 20px;
  }
  
  .settings-header h1 {
    font-size: 28px;
  }
  
  .settings-subtitle {
    font-size: 16px;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .settings-card-header {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  
  .settings-card-icon {
    align-self: center;
  }
  
  .avatar-preview img,
  .avatar-placeholder {
    width: 100px;
    height: 100px;
  }
}
  
/* Дашборд - современный дизайн */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
  padding: 32px;
  background: linear-gradient(135deg, var(--surface), rgba(37, 99, 235, 0.05));
  border-radius: 20px;
  border: 1px solid var(--border);
}

.dashboard-title h1 {
  margin: 0 0 12px 0;
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.dashboard-subtitle {
  margin: 0;
  font-size: 18px;
  color: var(--muted);
  font-weight: 500;
}

.dashboard-actions .btn {
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
}

.btn-icon {
  width: 20px;
  height: 20px;
}

/* Статистика */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.stat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  overflow: hidden;
  transition: all 0.4s ease;
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15), 0 4px 12px rgba(15, 23, 42, 0.1);
}

.stat-card-primary {
  border-color: rgba(37, 99, 235, 0.2);
}

.stat-card-secondary {
  border-color: rgba(168, 85, 247, 0.2);
}

.stat-card-success {
  border-color: rgba(34, 197, 94, 0.2);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}

.stat-card-primary .stat-icon {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
}

.stat-card-secondary .stat-icon {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: white;
}

.stat-card-success .stat-icon {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
}

.stat-icon svg {
  width: 28px;
  height: 28px;
}

.stat-content {
  position: relative;
  z-index: 2;
}

.stat-value {
  font-size: 48px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1;
}

.stat-label {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.stat-description {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
}

.stat-time {
  font-size: 16px;
  color: var(--primary);
  font-weight: 600;
  margin-top: 4px;
}

.stat-empty {
  color: var(--muted);
  font-style: italic;
}

.stat-bg {
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.03) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 1;
}

.stat-card-secondary .stat-bg {
  background: radial-gradient(circle, rgba(168, 85, 247, 0.03) 0%, transparent 70%);
}

.stat-card-success .stat-bg {
  background: radial-gradient(circle, rgba(34, 197, 94, 0.03) 0%, transparent 70%);
}

/* Секции дашборда */
.dashboard-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.section-title h2 {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.section-title p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-outline:hover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
  color: var(--primary);
}

/* Таблица анализов */
.analyses-table {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.analysis-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
}

.analysis-item:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.1);
}

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

.analysis-date {
  display: flex;
  align-items: center;
  gap: 16px;
}

.date-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.date-icon svg {
  width: 24px;
  height: 24px;
}

.date-info {
  display: flex;
  flex-direction: column;
}

.date-main {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.date-time {
  font-size: 14px;
  color: var(--muted);
}

.analysis-actions {
  display: flex;
  gap: 12px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 10px;
  font-weight: 600;
}

.btn-icon-sm {
  width: 16px;
  height: 16px;
}

.analysis-files {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.file-item:hover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.02);
}

.file-report {
  border-left: 4px solid var(--primary);
}

.file-extra {
  border-left: 4px solid var(--muted);
}

.file-icon {
  width: 40px;
  height: 40px;
  background: var(--surface-hover);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.file-icon svg {
  width: 20px;
  height: 20px;
}

.file-info {
  flex: 1;
}

.file-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.file-type {
  font-size: 14px;
  color: var(--muted);
}

/* Пустое состояние */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-icon {
  width: 80px;
  height: 80px;
  background: var(--surface-hover);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: var(--muted);
}

.empty-icon svg {
  width: 40px;
  height: 40px;
}

.empty-state h3 {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.empty-state p {
  margin: 0 0 24px 0;
  font-size: 16px;
  line-height: 1.5;
}

/* Адаптивность */
@media (max-width: 768px) {
  .dashboard-container {
    padding: 16px;
  }
  
  .dashboard-header {
    flex-direction: column;
    gap: 20px;
    padding: 24px;
  }
  
  .dashboard-title h1 {
    font-size: 28px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .stat-card {
    padding: 24px;
  }
  
  .stat-value {
    font-size: 36px;
  }
  
  .section-header {
    flex-direction: column;
    gap: 16px;
  }
  
  .analysis-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .analysis-actions {
    width: 100%;
    justify-content: stretch;
  }
  
  .analysis-actions .btn {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .dashboard-title h1 {
    font-size: 24px;
  }
  
  .dashboard-subtitle {
    font-size: 16px;
  }
  
  .stat-card {
    padding: 20px;
  }
  
  .stat-value {
    font-size: 32px;
  }
  
  .dashboard-section {
    padding: 20px;
  }
}
  
/* Чат - современный стильный дизайн */
.chat-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding: 32px;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, rgba(37, 99, 235, 0.08) 100%);
  border-radius: 24px;
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
  box-shadow: 0 10px 40px rgba(37, 99, 235, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
}

.chat-header::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 2px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(99, 102, 241, 0.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.chat-header:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 50px rgba(37, 99, 235, 0.16), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.chat-title h1 {
  margin: 0 0 10px 0;
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.chat-title p {
  margin: 0;
  color: #64748b;
  font-size: 16px;
  font-weight: 500;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #ffffff, #f0fdf4);
  border: 2px solid rgba(34, 197, 94, 0.2);
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  color: #166534;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
  transition: all 0.3s ease;
}

.chat-status:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.25);
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  animation: statusPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
}

.status-indicator.online {
  background: #22c55e;
}

@keyframes statusPulse {
  0%, 100% { 
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  50% { 
    opacity: 0.8;
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
}

/* Основной чат */
.chat-card {
  background: linear-gradient(to bottom, #ffffff, #f8fafc);
  border: 2px solid rgba(37, 99, 235, 0.1);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(37, 99, 235, 0.06);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 500px;
  transition: all 0.3s ease;
}

.chat-card:hover {
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.1), 0 12px 32px rgba(37, 99, 235, 0.08);
}

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  background: linear-gradient(to bottom, #fafbfc 0%, #f1f5f9 100%);
  position: relative;
}

.chat-scroll::-webkit-scrollbar {
  width: 8px;
}

.chat-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 10px;
}

.chat-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.chat-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #94a3b8, #64748b);
}

/* Современные стили для сообщений */
.chat-scroll .messages {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.chat-scroll .msg {
  display: flex;
  max-width: 100%;
  margin: 0;
  animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-scroll .msg.you {
  justify-content: flex-end;
}

.chat-scroll .bubble {
  max-width: 70%;
  padding: 18px 24px;
  border-radius: 20px;
  background: #ffffff;
  border: 2px solid rgba(148, 163, 184, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.chat-scroll .bubble:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.chat-scroll .msg.you .bubble {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
  border: none;
  color: white;
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.3), 0 4px 12px rgba(37, 99, 235, 0.2);
  position: relative;
  overflow: hidden;
}

.chat-scroll .msg.you .bubble::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.chat-scroll .msg.you .bubble:hover::before {
  left: 100%;
}

.chat-scroll .msg.you .bubble:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 48px rgba(37, 99, 235, 0.35), 0 8px 20px rgba(37, 99, 235, 0.25);
}

.chat-scroll .meta {
  display: flex;
  gap: 10px;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-scroll .msg.you .meta {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-scroll .text {
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 15px;
  font-weight: 500;
}

/* Файлы в сообщениях */
.chat-scroll .files {
  margin-top: 12px;
}

.chat-scroll .files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin: 8px 0 0 0;
}

.chat-scroll .file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
  margin: 0;
}

.chat-scroll .file-item:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.chat-scroll .file-item.image {
  padding: 6px;
  border-radius: 12px;
  overflow: hidden;
}

.chat-scroll .file-item.image img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.chat-scroll .file-item.audio {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.chat-scroll .file-item.audio audio {
  width: 100%;
  height: 32px;
}

.chat-scroll .file-item.doc .icon {
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.chat-scroll .file-item .name {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.chat-scroll .file-item .meta {
  font-size: 11px;
  color: var(--muted);
}

/* Композер */
.composer {
  background: linear-gradient(to top, #ffffff, #fafbfc);
  border-top: 2px solid rgba(37, 99, 235, 0.1);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.04);
}

.attach-btn {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(37, 99, 235, 0.15);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffffff, #f0f9ff);
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.attach-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(99, 102, 241, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.attach-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

.attach-btn:hover::before {
  opacity: 1;
}

.attach-btn svg {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 1;
}

.attach-btn:hover svg {
  transform: scale(1.15) rotate(5deg);
}

.badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.composer textarea {
  flex: 1;
  min-height: 48px;
  max-height: 120px;
  padding: 12px 18px;
  border: 2px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  background: #ffffff;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  resize: none;
  outline: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  font-weight: 500;
  font-family: inherit;
}

.composer textarea::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.composer textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), 0 4px 16px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.send-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.send-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.4), 0 4px 12px rgba(37, 99, 235, 0.3);
}

.send-btn:active {
  transform: translateY(-1px) scale(1.02);
}

.send-btn svg {
  transition: transform 0.3s ease;
}

.send-btn:hover svg {
  transform: translateX(2px);
}

/* Файловые чипы */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding: 0 24px;
}

.chips.hidden {
  display: none;
}

.badge.hidden {
  display: none;
}

.chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #ffffff, #f0f9ff);
  border: 2px solid rgba(37, 99, 235, 0.15);
  border-radius: 24px;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: chipIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes chipIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.15);
  border-color: #2563eb;
}

.chip-icon {
  font-size: 18px;
}

.chip-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.chip-size {
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}

.chip-x {
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 50%;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chip-x:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  transform: rotate(90deg) scale(1.1);
}

/* Прогресс загрузки */
.progress {
  background: linear-gradient(135deg, #ffffff, #f0f9ff);
  border: 2px solid rgba(37, 99, 235, 0.15);
  border-radius: 16px;
  padding: 18px;
  margin: 12px 24px 0;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
}

.progress.hidden {
  display: none;
}

.progress .bar {
  height: 10px;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
  position: relative;
}

.progress .bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
  width: var(--progress, 0%);
  transition: width 0.3s ease;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.6);
}

.progress .label {
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
}

/* Адаптивность чата */
@media (max-width: 768px) {
  .chat-container {
    padding: 8px;
  }
  
  .chat-header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
    padding: 16px;
    margin-bottom: 16px;
  }
  
  .chat-title h1 {
    font-size: 24px;
  }
  
  .chat-card {
    height: calc(100vh - 200px);
    min-height: 400px;
    border-radius: 12px;
  }
  
  .chat-scroll {
    padding: 16px;
  }
  
  .chat-scroll .bubble {
    max-width: 85%;
    padding: 12px 16px;
  }
  
  .composer {
    padding: 12px;
    gap: 8px;
  }
  
  .composer textarea {
    min-width: 150px;
    font-size: 16px;
  }
  
  .attach-btn, .send-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }
  
  .chips {
    margin-bottom: 8px;
  }
  
  .chip {
    font-size: 12px;
    padding: 6px 8px;
  }
  
  .chip-name {
    max-width: 100px;
  }
}

@media (max-width: 480px) {
  .chat-container {
    padding: 4px;
  }
  
  .chat-title h1 {
    font-size: 20px;
    margin: 0 0 8px 0;
  }
  
  .chat-title p {
    font-size: 14px;
  }
  
  .chat-header {
    padding: 12px;
    margin-bottom: 8px;
  }
  
  .chat-card {
    height: calc(100vh - 160px);
    min-height: 350px;
  }
  
  .chat-scroll {
    padding: 12px;
  }
  
  .chat-scroll .bubble {
    max-width: 90%;
    padding: 10px 12px;
    font-size: 14px;
  }
  
  .composer {
    padding: 8px;
  }
  
  .attach-btn, .send-btn {
    width: 36px;
    height: 36px;
  }
  
  .progress {
    padding: 8px;
    margin-top: 8px;
  }
}

/* Чат тренера - стильный градиентный дизайн */
.chat-trainer .trainer-header {
  background: linear-gradient(135deg, #fef3c7 0%, #fce7f3 30%, #f3e8ff 70%, rgba(168, 85, 247, 0.08) 100%);
  border: 2px solid transparent;
  box-shadow: 0 10px 40px rgba(168, 85, 247, 0.15), 0 2px 8px rgba(245, 158, 11, 0.08);
  position: relative;
}

.chat-trainer .trainer-header::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 2px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.4), rgba(168, 85, 247, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.chat-trainer .trainer-header:hover {
  box-shadow: 0 15px 50px rgba(168, 85, 247, 0.2), 0 4px 12px rgba(245, 158, 11, 0.12);
}

.chat-trainer .trainer-header h1 {
  background: linear-gradient(135deg, #f59e0b 0%, #ec4899 40%, #a855f7 80%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  letter-spacing: -0.5px;
  animation: gradientShift 6s ease infinite;
  background-size: 200% auto;
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}

.chat-trainer .trainer-status {
  background: linear-gradient(135deg, #fffbeb, #fef3c7, #fce7f3);
  border: 2px solid rgba(168, 85, 247, 0.25);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.2), 0 0 40px rgba(245, 158, 11, 0.1);
}

.chat-trainer .trainer-status:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(168, 85, 247, 0.3), 0 0 50px rgba(245, 158, 11, 0.15);
}

.chat-trainer .trainer-indicator {
  background: linear-gradient(135deg, #f59e0b, #a855f7);
  animation: trainerPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7);
}

@keyframes trainerPulse {
  0%, 100% { 
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7), 0 0 12px rgba(245, 158, 11, 0.5);
  }
  50% { 
    opacity: 0.85;
    transform: scale(1.15);
    box-shadow: 0 0 0 8px rgba(168, 85, 247, 0), 0 0 20px rgba(245, 158, 11, 0);
  }
}

.chat-trainer .trainer-card {
  border: 2px solid rgba(168, 85, 247, 0.15);
  background: linear-gradient(to bottom, #fffbeb, #fef3c7);
  box-shadow: 0 20px 60px rgba(168, 85, 247, 0.12), 0 8px 24px rgba(245, 158, 11, 0.08);
}

.chat-trainer .trainer-card:hover {
  box-shadow: 0 25px 70px rgba(168, 85, 247, 0.15), 0 12px 32px rgba(245, 158, 11, 0.1);
}

.chat-trainer .chat-scroll {
  background: linear-gradient(to bottom, #fffef5 0%, #fef3c7 100%);
}

.chat-trainer .trainer-composer {
  border-top: 2px solid rgba(168, 85, 247, 0.15);
  background: linear-gradient(to top, #fffbeb, #fef9f3);
  box-shadow: 0 -8px 24px rgba(168, 85, 247, 0.08);
}

.chat-trainer .trainer-attach {
  border-color: rgba(168, 85, 247, 0.2);
  background: linear-gradient(135deg, #ffffff, #fef3c7);
  color: #a855f7;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.1);
}

.chat-trainer .trainer-attach::before {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(168, 85, 247, 0.1));
}

.chat-trainer .trainer-attach:hover {
  border-color: #a855f7;
  color: #7c3aed;
  box-shadow: 0 8px 20px rgba(168, 85, 247, 0.25);
}

.chat-trainer .trainer-composer textarea {
  border-color: rgba(168, 85, 247, 0.2);
}

.chat-trainer .trainer-composer textarea:focus {
  border-color: #a855f7;
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.15), 0 4px 16px rgba(168, 85, 247, 0.12);
}

.chat-trainer .trainer-send {
  background: linear-gradient(135deg, #f59e0b 0%, #ec4899 40%, #a855f7 80%, #7c3aed 100%);
  background-size: 200% auto;
  animation: gradientShift 3s ease infinite;
  border: none;
  color: white;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
}

.chat-trainer .trainer-send:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 32px rgba(168, 85, 247, 0.45), 0 4px 12px rgba(245, 158, 11, 0.35);
}

.chat-trainer .trainer-badge {
  background: linear-gradient(135deg, #f59e0b, #ec4899, #a855f7);
  background-size: 200% auto;
  animation: gradientShift 3s ease infinite;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.5);
}

/* Сообщения тренера */
.chat-trainer .chat-scroll .msg.you .bubble {
  background: linear-gradient(135deg, #f59e0b 0%, #ec4899 40%, #a855f7 80%, #7c3aed 100%);
  background-size: 200% auto;
  box-shadow: 0 12px 32px rgba(168, 85, 247, 0.35), 0 4px 12px rgba(245, 158, 11, 0.25);
  border: none;
  animation: gradientShift 6s ease infinite;
}

.chat-trainer .chat-scroll .msg.you .bubble::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.chat-trainer .chat-scroll .msg.you .bubble:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 48px rgba(168, 85, 247, 0.4), 0 8px 20px rgba(245, 158, 11, 0.3);
}

.chat-trainer .chat-scroll .file-item:hover {
  border-color: #a855f7;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.15);
}

.chat-trainer .chat-scroll .file-item.doc .icon {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(168, 85, 247, 0.15));
  color: #a855f7;
}

.chat-trainer .chat-scroll .file-item .name {
  color: #a855f7;
  font-weight: 600;
}

.chat-trainer .progress .bar::before {
  background: linear-gradient(90deg, #f59e0b 0%, #ec4899 40%, #a855f7 80%, #7c3aed 100%);
  background-size: 200% auto;
  animation: gradientShift 3s ease infinite;
}

/* Отличия в чипах файлов для тренера */
.chat-trainer .chip {
  border-color: rgba(168, 85, 247, 0.2);
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.1);
}

.chat-trainer .chip:hover {
  border-color: #a855f7;
  box-shadow: 0 6px 16px rgba(168, 85, 247, 0.2);
}

.chat-trainer .chip-x:hover {
  background: linear-gradient(135deg, #f59e0b, #a855f7);
}

/* Адаптивность для тренера */
@media (max-width: 768px) {
  .chat-trainer .trainer-header {
    background: linear-gradient(135deg, var(--surface), rgba(168, 85, 247, 0.03));
  }
}

@media (max-width: 480px) {
  .chat-trainer .trainer-header h1 {
    font-size: 20px;
  }
}

/* Toast уведомления - стильный дизайн */
.toast-notification {
  position: fixed;
  top: 80px;
  right: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border: 2px solid rgba(34, 197, 94, 0.3);
  border-radius: 20px;
  padding: 20px 26px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(34, 197, 94, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 340px;
  max-width: 480px;
  z-index: 10000;
  animation: slideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1), fadeOut 0.4s ease-in-out 4.6s forwards;
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.toast-notification::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 2px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.4), rgba(16, 185, 129, 0.2));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.toast-notification:hover {
  transform: translateX(-6px) translateY(-3px) scale(1.02);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.16), 0 12px 32px rgba(34, 197, 94, 0.3);
}

.toast-notification.trainer {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 50%, #fce7f3 100%);
  border-color: rgba(168, 85, 247, 0.35);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(168, 85, 247, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

.toast-notification.trainer::before {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.4), rgba(168, 85, 247, 0.3));
}

.toast-notification.trainer:hover {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.16), 0 12px 32px rgba(168, 85, 247, 0.35);
}

.toast-icon {
  font-size: 36px;
  line-height: 1;
  animation: iconBounce 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 17px;
  font-weight: 800;
  color: #166534;
  margin: 0 0 6px 0;
  background: linear-gradient(135deg, #166534 0%, #22c55e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.toast-notification.trainer .toast-title {
  background: linear-gradient(135deg, #f59e0b 0%, #ec4899 50%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.toast-message {
  font-size: 14px;
  color: #475569;
  margin: 0;
  line-height: 1.5;
  font-weight: 500;
}

.toast-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.12);
  border: 2px solid rgba(148, 163, 184, 0.2);
  color: #64748b;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.toast-close:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: transparent;
  color: white;
  transform: rotate(90deg) scale(1.15);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

@keyframes slideInRight {
  0% {
    opacity: 0;
    transform: translateX(450px) scale(0.9);
  }
  60% {
    transform: translateX(-10px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes fadeOut {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(450px) scale(0.9);
  }
}

@keyframes iconBounce {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  20% {
    transform: scale(1.35) rotate(-5deg);
  }
  40% {
    transform: scale(0.85) rotate(5deg);
  }
  60% {
    transform: scale(1.15) rotate(-3deg);
  }
  80% {
    transform: scale(0.95) rotate(2deg);
  }
}

@media (max-width: 768px) {
  .toast-notification {
    top: 60px;
    right: 16px;
    left: 16px;
    min-width: unset;
    max-width: unset;
    padding: 16px 20px;
    border-radius: 16px;
  }
  
  .toast-icon {
    font-size: 32px;
  }
  
  .toast-title {
    font-size: 16px;
  }
  
  .toast-message {
    font-size: 13px;
  }
  
  .toast-close {
    width: 28px;
    height: 28px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .toast-notification {
    top: 50px;
    right: 12px;
    left: 12px;
    padding: 14px 18px;
  }
  
  .toast-icon {
    font-size: 28px;
  }
  
  .toast-title {
    font-size: 15px;
  }
  
  .toast-message {
    font-size: 12px;
  }
}
  
/* История звонков - современный дизайн */
.calls-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.calls-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  padding: 32px;
  background: linear-gradient(135deg, var(--surface), rgba(37, 99, 235, 0.05));
  border-radius: 20px;
  border: 1px solid var(--border);
}

.calls-title h1 {
  margin: 0 0 12px 0;
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
}

.calls-title p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

/* Информационная карточка */
.info-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

.info-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.info-icon svg {
  width: 24px;
  height: 24px;
}

.info-content h3 {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.info-content p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Таблица звонков */
.calls-table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.calls-table {
  display: flex;
  flex-direction: column;
}

.call-item {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}

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

.call-item:hover {
  background: var(--bg);
}

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

.call-number {
  display: flex;
  align-items: center;
}

.number-badge {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.call-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.date-main {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.date-time {
  font-size: 14px;
  color: var(--muted);
}

.call-actions {
  display: flex;
  gap: 12px;
}

/* Файлы звонка */
.call-files {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.file-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.file-icon {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.file-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 8px;
  transition: all 0.2s ease;
  display: inline-block;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-link:hover {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.file-link.extra {
  background: rgba(168, 85, 247, 0.05);
  border-color: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

.file-link.extra:hover {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.2);
}

.extra-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Пустое состояние */
.empty-calls {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

.empty-calls .empty-icon {
  width: 80px;
  height: 80px;
  background: var(--surface-hover);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: var(--muted);
}

.empty-calls .empty-icon svg {
  width: 40px;
  height: 40px;
}

.empty-calls h3 {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.empty-calls p {
  margin: 0 0 24px 0;
  font-size: 16px;
  line-height: 1.5;
}

/* Адаптивность истории звонков */
@media (max-width: 768px) {
  .calls-container {
    padding: 16px;
  }
  
  .calls-header {
    flex-direction: column;
    gap: 20px;
    padding: 24px;
  }
  
  .calls-title h1 {
    font-size: 28px;
  }
  
  .info-card {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }
  
  .call-header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .call-actions {
    width: 100%;
    justify-content: center;
  }
  
  .call-actions .btn {
    flex: 1;
    max-width: 200px;
  }
}

@media (max-width: 480px) {
  .calls-title h1 {
    font-size: 24px;
  }
  
  .calls-title p {
    font-size: 14px;
  }
  
  .call-item {
    padding: 20px;
  }
  
  .file-link {
    max-width: 100%;
    font-size: 14px;
  }
}
  
/* Zoom встречи */
.zoom-meetings-container {
  margin-top: 20px;
}

.zoom-meetings-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.meeting-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.meeting-item:hover {
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.meeting-item.status-scheduled {
  border-left: 4px solid #3b82f6;
}

.meeting-item.status-active {
  border-left: 4px solid #10b981;
}

.meeting-item.status-completed {
  border-left: 4px solid #6b7280;
}

.meeting-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.meeting-info {
  flex: 1;
}

.meeting-topic {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.meeting-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
}

.meeting-time,
.meeting-duration,
.meeting-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.meeting-status.status-scheduled {
  color: #3b82f6;
  font-weight: 500;
}

.meeting-status.status-active {
  color: #10b981;
  font-weight: 500;
}

.meeting-status.status-completed {
  color: #6b7280;
  font-weight: 500;
}

.meeting-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-agent-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37, 99, 235, 0.1);
  color: #3b82f6;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  margin-top: 12px;
}

/* Модальные окна */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
}

.modal-content {
  background-color: var(--surface);
  margin: 20px auto;
  padding: 0;
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  min-height: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.3s ease-out;
  position: relative;
}

.modal-large {
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 0 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.modal-body {
  padding: 40px;
  max-height: 70vh;
  overflow-y: auto;
  min-height: 400px;
}

/* Формы */
.form-group {
  margin-bottom: 32px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: all 0.2s ease;
  min-height: 50px;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  position: relative;
  transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.form-actions {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

/* Улучшенные стили для форм */
.datetime-picker {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.date-section,
.time-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.date-section label,
.time-section label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

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

.time-inputs {
  display: flex;
  align-items: center;
  gap: 12px;
}

.time-separator {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.date-inputs select,
.time-inputs select {
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  min-height: 50px;
}

.date-inputs select:focus,
.time-inputs select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.date-inputs select:hover,
.time-inputs select:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}



.datetime-input-wrapper {
  position: relative;
}

.datetime-help {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.datetime-help small {
  color: var(--text-muted);
}

.duration-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.duration-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 20px;
  border: 2px solid var(--border);
  border-radius: 10px;
  transition: all 0.2s ease;
  background: var(--surface);
  min-height: 60px;
}

.duration-option:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}

.duration-option input[type="radio"] {
  display: none;
}

.duration-option input[type="radio"]:checked + .duration-label {
  color: var(--primary);
}

.duration-option input[type="radio"]:checked {
  border-color: var(--primary);
}

.duration-option input[type="radio"]:checked + .duration-label .duration-time {
  color: var(--primary);
  font-weight: 600;
}

.duration-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.duration-time {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.duration-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Стили для валидации */
.form-group input:invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group input:invalid + .datetime-help {
  color: var(--error);
}

.form-group input:invalid + .datetime-help small {
  color: var(--error);
}

/* Детали встречи */
.meeting-details {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.meeting-info-section h4,
.transcript-section h4 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

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

.info-item label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.info-item span {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.status-scheduled {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.status-badge.status-active {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.status-badge.status-completed {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.meeting-actions-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* Транскрипт */
.transcript-content {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.transcript-text {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
  max-height: 300px;
  overflow-y: auto;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.transcript-meta {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.transcript-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Уведомления */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  max-width: 400px;
  animation: slideIn 0.3s ease-out;
}

.notification-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  font-weight: 500;
}

.notification-success {
  background: #10b981;
  color: white;
}

.notification-error {
  background: #ef4444;
  color: white;
}

.notification-info {
  background: #3b82f6;
  color: white;
}

.notification-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.notification-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Загрузка */
.loading-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 20px;
  color: var(--muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.empty-icon {
  width: 64px;
  height: 64px;
  color: var(--border);
}

.empty-state h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
}

.empty-state p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Адаптивность Zoom */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 10% auto;
  }
  
  .meeting-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .meeting-actions {
    justify-content: stretch;
  }
  
  .meeting-actions .btn {
    flex: 1;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .form-actions .btn {
    width: 100%;
  }
}

/* ========================================
   ТЕМНЫЙ РЕЖИМ ДЛЯ ЧАТА
   ======================================== */

body.dark .chat-header {
  background: linear-gradient(135deg, #111827 0%, #1e293b 50%, rgba(37, 99, 235, 0.15) 100%);
  border: 2px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(59, 130, 246, 0.1);
}

body.dark .chat-header::before {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(99, 102, 241, 0.2));
}

body.dark .chat-title h1 {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.dark .chat-title p {
  color: #94a3b8;
}

body.dark .chat-status {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid rgba(34, 197, 94, 0.3);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
  color: #86efac;
}

body.dark .chat-card {
  background: linear-gradient(to bottom, #0f172a, #1e293b);
  border: 2px solid rgba(59, 130, 246, 0.15);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(59, 130, 246, 0.1);
}

body.dark .chat-scroll {
  background: linear-gradient(to bottom, #0a0e1a 0%, #111827 100%);
}

body.dark .chat-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

body.dark .chat-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #334155, #475569);
}

body.dark .chat-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #475569, #64748b);
}

body.dark .chat-scroll .bubble {
  background: #1e293b;
  border: 2px solid rgba(71, 85, 105, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.3);
}

body.dark .chat-scroll .bubble:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
}

body.dark .chat-scroll .msg.you .bubble {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
  border: none;
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.4), 0 4px 12px rgba(37, 99, 235, 0.3);
}

body.dark .chat-scroll .msg.you .bubble:hover {
  box-shadow: 0 16px 48px rgba(37, 99, 235, 0.5), 0 8px 20px rgba(37, 99, 235, 0.4);
}

body.dark .chat-scroll .meta {
  color: #94a3b8;
}

body.dark .chat-scroll .text {
  color: #e2e8f0;
}

body.dark .composer {
  background: linear-gradient(to top, #0f172a, #1e293b);
  border-top: 2px solid rgba(59, 130, 246, 0.15);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
}

body.dark .attach-btn {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid rgba(59, 130, 246, 0.2);
  color: #94a3b8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark .attach-btn:hover {
  border-color: #3b82f6;
  color: #60a5fa;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

body.dark .composer textarea {
  background: #1e293b;
  border: 2px solid rgba(71, 85, 105, 0.3);
  color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark .composer textarea::placeholder {
  color: #64748b;
}

body.dark .composer textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 4px 16px rgba(59, 130, 246, 0.2);
  background: #0f172a;
}

body.dark .send-btn {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
}

body.dark .send-btn:hover {
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.5), 0 4px 12px rgba(37, 99, 235, 0.4);
}

body.dark .chip {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid rgba(59, 130, 246, 0.2);
  color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark .chip:hover {
  border-color: #3b82f6;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.25);
}

body.dark .chip-name {
  color: #f1f5f9;
}

body.dark .chip-size {
  color: #94a3b8;
}

body.dark .chip-x {
  background: rgba(71, 85, 105, 0.3);
  color: #94a3b8;
}

body.dark .chip-x:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

body.dark .progress {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body.dark .progress .bar {
  background: rgba(59, 130, 246, 0.2);
}

body.dark .progress .bar::before {
  background: linear-gradient(90deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.8);
}

body.dark .progress .label {
  color: #e2e8f0;
}

body.dark .chat-scroll .file-item {
  background: #1e293b;
  border-color: rgba(71, 85, 105, 0.3);
}

body.dark .chat-scroll .file-item:hover {
  border-color: #3b82f6;
  background: #0f172a;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

body.dark .chat-scroll .file-item .name {
  color: #60a5fa;
}

body.dark .chat-scroll .file-item .meta {
  color: #94a3b8;
}

/* Темный режим для чата тренера */
body.dark .chat-trainer .trainer-header {
  background: linear-gradient(135deg, #1e1410 0%, #2d1b14 30%, #1e1420 70%, rgba(168, 85, 247, 0.15) 100%);
  border: 2px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(245, 158, 11, 0.15);
}

body.dark .chat-trainer .trainer-header::before {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.5), rgba(168, 85, 247, 0.4));
}

body.dark .chat-trainer .trainer-status {
  background: linear-gradient(135deg, #2d1b14, #1e1410);
  border: 2px solid rgba(168, 85, 247, 0.35);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3), 0 0 40px rgba(245, 158, 11, 0.15);
}

body.dark .chat-trainer .trainer-card {
  background: linear-gradient(to bottom, #1a1410, #2d1b14);
  border: 2px solid rgba(168, 85, 247, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(168, 85, 247, 0.15);
}

body.dark .chat-trainer .chat-scroll {
  background: linear-gradient(to bottom, #140f0a 0%, #2d1b14 100%);
}

body.dark .chat-trainer .trainer-composer {
  background: linear-gradient(to top, #1a1410, #2d1b14);
  border-top: 2px solid rgba(168, 85, 247, 0.2);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
}

body.dark .chat-trainer .trainer-attach {
  background: linear-gradient(135deg, #2d1b14, #1a1410);
  border-color: rgba(168, 85, 247, 0.3);
  color: #c084fc;
}

body.dark .chat-trainer .trainer-attach:hover {
  border-color: #a855f7;
  color: #d8b4fe;
  box-shadow: 0 8px 20px rgba(168, 85, 247, 0.35);
}

body.dark .chat-trainer .trainer-composer textarea {
  background: #2d1b14;
  border-color: rgba(168, 85, 247, 0.3);
  color: #e2e8f0;
}

body.dark .chat-trainer .trainer-composer textarea:focus {
  border-color: #a855f7;
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.2), 0 4px 16px rgba(168, 85, 247, 0.25);
  background: #1a1410;
}

body.dark .chat-trainer .chip {
  background: linear-gradient(135deg, #2d1b14, #1a1410);
  border-color: rgba(168, 85, 247, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark .chat-trainer .chip:hover {
  border-color: #a855f7;
  box-shadow: 0 6px 16px rgba(168, 85, 247, 0.3);
}

/* Toast уведомления в темном режиме */
body.dark .toast-notification {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid rgba(34, 197, 94, 0.4);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(34, 197, 94, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body.dark .toast-notification::before {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.5), rgba(16, 185, 129, 0.3));
}

body.dark .toast-notification.trainer {
  background: linear-gradient(135deg, #2d1b14 0%, #1a1410 50%, #1e1420 100%);
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(168, 85, 247, 0.35);
}

body.dark .toast-notification.trainer::before {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.5), rgba(168, 85, 247, 0.4));
}

body.dark .toast-title {
  color: #86efac;
}

body.dark .toast-message {
  color: #cbd5e1;
}

body.dark .toast-close {
  background: rgba(71, 85, 105, 0.2);
  border-color: rgba(71, 85, 105, 0.3);
  color: #94a3b8;
}

body.dark .toast-close:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-color: transparent;
  color: white;
}
  