@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Цветовая палитра */
  --primary: #E4002B; /* KFC Red */
  --primary-hover: #ff1a43;
  --primary-glow: rgba(228, 0, 43, 0.4);
  
  --bg-gradient: radial-gradient(circle at 50% 0%, #1e1e24 0%, #0c0c0e 100%);
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-bg-hover: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.15);
  --glass-blur: blur(20px);
  
  /* Статусные цвета */
  --status-active: #3182ce;
  --status-completed: #38a169;
  --status-overdue: #e53e3e;
  --status-pending: #dd6b20;
  
  /* Текст */
  --text-main: #f7fafc;
  --text-muted: #a0aec0;
  --text-dark: #4a5568;
  
  /* Размеры и скругления */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Светлая тема */
body.light-theme {
  --bg-gradient: linear-gradient(to bottom, #eef2f4 0%, #e2e8ec 100%);
  
  /* Glassmorphism адаптированный под плоский дизайн Bitrix24 */
  --glass-bg: #ffffff;
  --glass-bg-hover: #ffffff;
  --glass-border: #edeef0;
  --glass-border-hover: #d5dbde;
  --glass-blur: none; /* Убираем размытие для светлой темы, так как Bitrix24 плоский */
  
  /* Текст */
  --text-main: #333333; /* Основной текст Bitrix24 */
  --text-muted: #525c69; /* Второстепенный текст Bitrix24 */
  --text-dark: #828b95;
}

body.light-theme .glass-panel {
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.03), 0 1px 1px 0 rgba(0, 0, 0, 0.03);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.light-theme .glass-panel:hover {
  border-color: #c6d0d5;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.05);
}

body.light-theme .avatar {
  background: #f0f4f6;
}

body.light-theme .avatar-wrapper {
  background: #e2e8eb;
  padding: 1px;
}

body.light-theme .user-meta h1 {
  background: none;
  -webkit-text-fill-color: initial;
  color: #333333;
  font-weight: 700;
}

body.light-theme .user-meta p {
  color: #828b95;
}

body.light-theme .header-actions .btn-icon {
  background: #f0f4f6;
  border-color: transparent;
  color: #525c69;
}

body.light-theme .header-actions .btn-icon:hover {
  background: #e2e8ec;
  color: #2067b0;
}

body.light-theme .next-meeting-card {
  background: linear-gradient(135deg, rgba(228, 0, 43, 0.04) 0%, #ffffff 100%);
  border: 1px solid rgba(228, 0, 43, 0.2);
  box-shadow: 0 4px 12px 0 rgba(228, 0, 43, 0.03);
}

body.light-theme .next-meeting-card:hover {
  border-color: rgba(228, 0, 43, 0.4);
  box-shadow: 0 6px 16px 0 rgba(228, 0, 43, 0.08);
}

body.light-theme .next-meeting-countdown {
  color: var(--primary);
}

body.light-theme .next-meeting-countdown span {
  color: #828b95;
}

body.light-theme .participant-avatar {
  border-color: #fff;
  background: #f0f4f6;
}

/* Статистика */
body.light-theme .stat-card {
  background: #ffffff;
  border: 1px solid #edeef0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

body.light-theme .stat-card:hover {
  background: #ffffff;
  border-color: #d5dbde;
}

body.light-theme .stat-card:has(.stat-completed) { 
  border-left: 4px solid #38a169; 
  background: rgba(56, 161, 105, 0.02); 
}
body.light-theme .stat-card:has(.stat-active) { 
  border-left: 4px solid #3182ce; 
  background: rgba(49, 130, 206, 0.02); 
}
body.light-theme .stat-card:has(.stat-overdue) { 
  border-left: 4px solid #e53e3e; 
  background: rgba(229, 62, 62, 0.02); 
}

/* Задачи */
body.light-theme .task-item {
  background: #ffffff;
  border: 1px solid #edeef0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

body.light-theme .task-item:hover {
  background: #ffffff;
  border-color: #c6d0d5;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04);
}

body.light-theme .task-item.overdue {
  background: rgba(229, 62, 62, 0.01);
  border-left: 4px solid #e53e3e;
  border-color: #edeef0;
}

body.light-theme .task-title-link {
  color: #2067b0; /* Синие ссылки как в Bitrix24 */
}

body.light-theme .task-title-link:hover {
  color: #117ed2;
  text-decoration: underline;
}

body.light-theme .status-badge {
  background: #f0f4f6;
  border-color: #e2e8eb;
  color: #525c69;
}

body.light-theme .progress-bar-bg {
  background: #f0f4f6;
}

/* Календарь */
body.light-theme .event-item {
  background: #ffffff;
  border: 1px solid #edeef0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

body.light-theme .event-item:hover {
  background: #ffffff;
  border-color: #c6d0d5;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04);
}

body.light-theme .event-start {
  color: #333333;
}

body.light-theme .event-title {
  color: #333333;
}

body.light-theme .event-time-col {
  border-right-color: #edeef0;
}

/* Быстрые действия */
body.light-theme .action-btn {
  background: #f8fafb;
  border-color: #edeef0;
  color: #525c69;
  box-shadow: none;
}

body.light-theme .action-btn:hover {
  background: #f0f4f6;
  border-color: #d5dbde;
  color: #333333;
}

/* Кнопки управления задачами */
body.light-theme .btn-secondary {
  background: #f0f4f6;
  border-color: transparent;
  color: #525c69;
}

body.light-theme .btn-secondary:hover {
  background: #e2e8ec;
  color: #333333;
}

/* Формы / Модалки */
body.light-theme .modal-content {
  background: #ffffff;
  border-color: #d5dbde;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

body.light-theme .form-control {
  background: #ffffff;
  color: #333333;
  border-color: #c6d0d5;
}

body.light-theme .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 5px rgba(228, 0, 43, 0.2);
}

body.light-theme .close-btn {
  color: #828b95;
}

body.light-theme .close-btn:hover {
  color: #333333;
}

/* Уведомления */
body.light-theme .notification-popup {
  background: #ffffff;
  border-color: #d5dbde;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body.light-theme .notification-item {
  background: #f8fafb;
  border-color: #edeef0;
  color: #333333;
}

body.light-theme .notification-item:hover {
  background: #f0f4f6;
}

body.light-theme .toast {
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  color: #333333;
  border-color: #edeef0;
}

/* Сброс стилей */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  padding: 24px;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Скроллбар */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Заголовки */
h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Контейнер приложения */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Стеклянные карточки */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: var(--transition);
}

.glass-panel:hover {
  border-color: var(--glass-border-hover);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Шапка приложения */
.header-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 50; /* Чтобы выпадающие элементы были поверх всего */
}

.header-panel::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 0;
  width: 150px;
  height: 150px;
  background: var(--primary-glow);
  filter: blur(80px);
  pointer-events: none;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar-wrapper {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, var(--primary) 0%, rgba(255,255,255,0.1) 100%);
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #1a1a1e;
}

.user-meta h1 {
  font-size: 24px;
  background: linear-gradient(to right, #fff, #a0aec0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.user-meta p {
  font-size: 14px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Сетка основного контента */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.main-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Виджет: Следующая встреча */
.next-meeting-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(228, 0, 43, 0.08) 0%, rgba(0, 0, 0, 0.4) 100%);
  border: 1px solid rgba(228, 0, 43, 0.25);
  box-shadow: 0 8px 32px 0 rgba(228, 0, 43, 0.05);
}

.next-meeting-card:hover {
  border-color: rgba(228, 0, 43, 0.5);
  box-shadow: 0 8px 32px 0 rgba(228, 0, 43, 0.15);
}

.next-meeting-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 16px;
  letter-spacing: 0.05em;
  box-shadow: 0 0 10px var(--primary-glow);
}

.badge-solo-task {
  background: #3182ce !important;
  box-shadow: 0 0 10px rgba(49, 130, 206, 0.4) !important;
}

body.light-theme .badge-solo-task {
  background: #3182ce !important;
  box-shadow: 0 2px 8px rgba(49, 130, 206, 0.2) !important;
}

.next-meeting-title {
  font-size: 22px;
  margin-bottom: 12px;
  line-height: 1.3;
}

.next-meeting-countdown {
  font-family: 'Outfit', sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.next-meeting-countdown span {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
}

.meeting-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.meeting-participants {
  display: flex;
  align-items: center;
  gap: -8px; /* наложение аватарок */
  margin-top: 16px;
}

.participant-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #1a1a1e;
  object-fit: cover;
  background: #2a2a30;
}

/* Статистика сегодняшних задач */
.stats-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-card {
  text-align: center;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  transition: var(--transition);
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.05);
}

.stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-completed { color: var(--status-completed); }
.stat-active { color: var(--status-active); }
.stat-overdue { color: var(--status-overdue); }

/* Мои задачи */
.tasks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.task-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--glass-border);
  transition: var(--transition);
}

.task-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.task-item.overdue {
  border-left: 4px solid var(--status-overdue);
  background: rgba(229, 62, 98, 0.03);
}

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

.task-title-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  transition: var(--transition);
  line-height: 1.4;
}

.task-title-link:hover {
  color: var(--primary-hover);
}

.task-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.priority-high { background: rgba(229, 62, 98, 0.2); color: #feb2b2; border: 1px solid rgba(229, 62, 98, 0.3); }
.priority-medium { background: rgba(221, 107, 32, 0.2); color: #fbd38d; border: 1px solid rgba(221, 107, 32, 0.3); }
.priority-low { background: rgba(74, 85, 104, 0.3); color: var(--text-muted); }

.status-badge {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
}

.status-active-badge {
  background: rgba(49, 130, 206, 0.15);
  color: #90cdf4;
  border: 1px solid rgba(49, 130, 206, 0.3);
}

.task-middle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.task-deadline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-deadline.alert {
  color: #fc8181;
  font-weight: 600;
}

.task-progress-container {
  width: 120px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar-bg {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.task-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* Моё расписание */
.schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.event-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--glass-border);
  transition: var(--transition);
}

.event-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.event-time-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  border-right: 1px solid rgba(255,255,255,0.08);
  padding-right: 12px;
}

.event-start {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

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

.event-info-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.event-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

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

/* Быстрые действия */
.actions-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(4px);
}

.action-btn svg {
  color: var(--primary);
  transition: var(--transition);
}

.action-btn:hover svg {
  transform: scale(1.1);
  filter: drop-shadow(0 0 5px var(--primary-glow));
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px 0 rgba(228, 0, 43, 0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px 0 rgba(228, 0, 43, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
}

/* Центр Уведомлений */
.notification-bell-container {
  position: relative;
  cursor: pointer;
}

.bell-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  border: 2px solid #101014;
  box-shadow: 0 0 8px var(--primary-glow);
  display: none;
}

.bell-badge.active {
  display: block;
  animation: pulse 1.5s infinite;
}

.notification-popup {
  position: absolute;
  top: 60px;
  right: 24px;
  width: 360px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.notification-popup.active {
  display: block;
  animation: slideInDown 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  font-size: 13px;
  line-height: 1.4;
  transition: var(--transition);
}

.notification-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.notification-item.alert {
  border-left: 3px solid var(--status-overdue);
}

.notification-item.warning {
  border-left: 3px solid var(--status-pending);
}

.notification-item-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Модальные Окна */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content.modal-large {
  max-width: 850px;
  width: 95%;
}

.task-details-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .task-details-grid {
    grid-template-columns: 1fr;
  }
}

.task-details-info-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.task-details-desc-box h4,
.task-details-chat-col h4 {
  font-size: 14px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.task-details-desc {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 14px;
  color: var(--text-main);
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.5;
}

body.light-theme .task-details-desc {
  background: #f8fafb;
}

.task-details-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 480px) {
  .task-details-meta-grid {
    grid-template-columns: 1fr;
  }
}

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

.meta-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.meta-val {
  font-size: 14px;
  font-weight: 600;
}

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

.meta-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #2a2a30;
  border: 1px solid var(--glass-border);
}

.task-details-chat-col {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--glass-border);
  padding-left: 24px;
}

@media (max-width: 768px) {
  .task-details-chat-col {
    border-left: none;
    padding-left: 0;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
  }
}

.task-chat-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 320px;
  min-height: 200px;
  overflow-y: auto;
  padding-right: 8px;
  margin-bottom: 12px;
}

.chat-message-item {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.4;
  animation: slideInDown 0.2s ease;
}

.chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #2a2a30;
  border: 1px solid var(--glass-border);
}

.chat-bubble {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
  padding: 8px 12px;
}

body.light-theme .chat-bubble {
  background: #f8fafb;
}

.chat-author-name {
  font-weight: 600;
  margin-bottom: 2px;
  display: block;
}

.chat-message-time {
  font-size: 10px;
  color: var(--text-muted);
  float: right;
  margin-left: 8px;
  margin-top: 2px;
}

.task-chat-form {
  display: flex;
  gap: 8px;
}

/* Ссылка на задачу в списке */
.task-title-clickable {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1.4;
}

.task-title-clickable:hover {
  color: var(--primary);
  text-decoration: underline;
}

.task-external-link {
  color: var(--text-muted);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  vertical-align: middle;
}

.task-external-link:hover {
  color: var(--primary);
}


.modal-content {
  width: 100%;
  max-width: 500px;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

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

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  transition: var(--transition);
}

.close-btn:hover {
  color: #fff;
}

/* Элементы формы */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-family: 'Outfit', sans-serif;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Системные уведомления (тосты) */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 300;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: rgba(18, 18, 23, 0.85);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  backdrop-filter: var(--glass-blur);
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 14px;
  min-width: 250px;
  animation: slideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: var(--transition);
}

.toast.toast-success { border-left: 4px solid var(--status-completed); }
.toast.toast-error { border-left: 4px solid var(--status-overdue); }
.toast.toast-warning { border-left: 4px solid var(--status-pending); }

/* Спиннеры и пустое состояние */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-large {
  width: 40px;
  height: 40px;
  border-width: 3px;
  margin: 40px auto;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.1);
}

/* Анимации */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(228, 0, 43, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(228, 0, 43, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(228, 0, 43, 0); }
}

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

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

/* ==========================================================================
   Pomodoro Focus Timer Styles
   ========================================================================== */
#pomodoro-widget {
  position: relative;
}

.pomodoro-modes {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 20px;
  transition: var(--transition);
}

.pomodoro-mode-btn {
  padding: 6px 16px;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  border-radius: 15px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.pomodoro-mode-btn:hover {
  color: var(--text-main);
}

.pomodoro-mode-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Адаптация Pomodoro под светлую тему */
body.light-theme .pomodoro-modes {
  background: #edeef0;
}

body.light-theme .pomodoro-mode-btn {
  color: #525c69;
}

body.light-theme .pomodoro-mode-btn:hover {
  color: #333333;
}

body.light-theme .pomodoro-mode-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(228, 0, 43, 0.2);
}

body.light-theme #pomodoro-time {
  color: #333333;
}

/* ==========================================================================
   Task Details Quote, Gallery and Attachments Styles
   ========================================================================== */
.chat-quote {
  border-left: 3px solid var(--primary);
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  margin: 8px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  font-size: 13px;
  color: var(--text-muted);
}

body.light-theme .chat-quote {
  background: rgba(0, 0, 0, 0.02);
}

/* Галерея изображений в деталях задачи */
.task-details-images-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 16px;
  border-top: 1px solid var(--glass-border);
  padding-top: 16px;
}

.task-file-image-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-file-img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  transition: var(--transition);
  cursor: pointer;
}

.task-file-img:hover {
  border-color: var(--primary);
  transform: scale(1.03);
}

.task-file-img-name {
  font-size: 11px;
  color: var(--text-muted);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  text-align: center;
}

/* Список файлов задачи */
.task-details-files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.task-file-download-link {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--text-main);
  text-decoration: none;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--glass-border);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.task-file-download-link:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--primary);
  color: var(--primary);
}

body.light-theme .task-file-download-link {
  background: #f8fafb;
}

/* Вложения в чате */
.chat-attachments {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 6px;
}

body.light-theme .chat-attachments {
  border-top-color: rgba(0,0,0,0.05);
}

.chat-attachment-image {
  max-width: 150px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  margin-top: 4px;
}

.chat-img-preview {
  width: 100%;
  max-height: 100px;
  object-fit: cover;
  display: block;
  transition: var(--transition);
}

.chat-img-preview:hover {
  transform: scale(1.05);
}

.chat-attachment-file {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  margin-top: 4px;
}

.chat-attachment-file:hover {
  color: var(--primary);
  text-decoration: underline;
}

