.tm-view {
  position: fixed;
  inset: 0 0 0 260px;
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent;
  z-index: 10;
  display: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #e2e8f0;
}
.tm-view.visible { display: block; }

.tm-view::before {
  content: '';
  position: fixed;
  inset: 0 0 0 260px;
  background: rgba(0, 0, 0, 0.45);
  z-index: -1;
}

.tm-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.15) 0%, transparent 35%),
    radial-gradient(circle at 85% 85%, rgba(168, 85, 247, 0.1) 0%, transparent 35%);
}

.tm-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 80px 40px 100px;
  position: relative;
}

.tm-header-section {
  margin-bottom: 40px;
}

.tm-title {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tm-subtitle {
  font-size: 15px;
  color: #94a3b8;
  opacity: 0.8;
}

/* Glass Card */
.tm-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.tm-add-form {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 8px;
  transition: all 0.3s ease;
  flex-wrap: nowrap;
  align-items: center;
}

.tm-add-form:focus-within {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.tm-add-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 12px 8px;
  font-size: 15px;
  color: #fff;
  outline: none;
}

.tm-add-input::placeholder { color: #64748b; }

.tm-add-btn {
  background: var(--accent-gradient, linear-gradient(135deg, #6366f1 0%, #a855f7 100%));
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 0 16px;
  height: 44px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

.tm-add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.tm-add-btn:disabled { opacity: 0.5; transform: none; cursor: not-allowed; }

.tm-section-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tm-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
}

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

.tm-task {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 18px 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tm-task:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.tm-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2.5px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.tm-checkbox:hover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
}

.tm-task-body { flex: 1; min-width: 0; }

.tm-task-title {
  font-size: 15px;
  font-weight: 500;
  color: #f1f5f9;
  margin-bottom: 2px;
}

.tm-task-meta {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tm-task-due {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #60a5fa;
  margin-top: 6px;
  background: rgba(96, 165, 250, 0.1);
  padding: 2px 8px;
  border-radius: 20px;
}

.tm-task-due.overdue { 
  color: #f87171; 
  background: rgba(248, 113, 113, 0.1);
}

.tm-delete-btn, .tm-file-btn, .tm-assign-task-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  opacity: 0;
}

.tm-task:hover .tm-delete-btn, 
.tm-task:hover .tm-file-btn, 
.tm-task:hover .tm-assign-task-btn { 
  opacity: 1; 
}

.tm-delete-btn:hover { background: rgba(239, 68, 68, 0.15); color: #ef4444; border-color: rgba(239, 68, 68, 0.2); }
.tm-file-btn:hover, .tm-assign-task-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.tm-empty {
  text-align: center;
  padding: 60px 20px;
}

.tm-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.1));
}

.tm-empty-text { color: #94a3b8; font-size: 15px; line-height: 1.6; }

.tm-task.done { opacity: 0.5; }
.tm-task.done .tm-task-title { text-decoration: line-through; color: #64748b; }

.tm-assign-picker {
  position: fixed;
  min-width: 260px;
  max-width: calc(100vw - 32px);
  background: rgba(23, 23, 37, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 12px;
  z-index: 1000;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

.tm-assign-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.tm-assign-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.tm-assign-btn.has-selection { 
  background: rgba(99, 102, 241, 0.15); 
  color: #818cf8; 
  border-color: rgba(99, 102, 241, 0.3); 
}

.tm-task-assignees {
  display: flex;
  margin-right: 8px;
}

.tm-task-assignee {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.2);
  border: 2px solid rgba(23, 23, 37, 1);
  color: #a5b4fc;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -10px;
  transition: all 0.2s;
}
.tm-task-assignee:first-child { margin-left: 0; }
.tm-task-assignee:hover { transform: translateY(-3px) scale(1.1); z-index: 5; }

.tm-picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.tm-picker-item:hover { background: rgba(255, 255, 255, 0.1); }
.tm-picker-item.selected { background: rgba(99, 102, 241, 0.15); }

.tm-picker-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.tm-picker-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tm-picker-name { font-size: 13px; color: #f1f5f9; flex: 1; }
.tm-picker-check {
  width: 18px; height: 18px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
}
.tm-picker-item.selected .tm-picker-check {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

.tm-pending-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.tm-pending-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 4px 10px 4px 6px;
  font-size: 12px;
  color: #e2e8f0;
}
.tm-pending-badge-avatar {
  width: 20px; height: 20px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.2);
  font-size: 10px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* Modal styles removed in favor of global .app-modal-* */

.tm-file-popup {
  position: fixed; z-index: 300;
  background: rgba(23, 23, 37, 0.9);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 24px;
  min-width: 280px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
.tm-fp-title { 
  font-size: 12px; 
  font-weight: 700; 
  color: #64748b; 
  text-transform: uppercase; 
  letter-spacing: 0.1em; 
  margin-bottom: 16px; 
}
.tm-fp-file {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: 12px;
  transition: background 0.2s;
}
.tm-fp-file:hover { background: rgba(255, 255, 255, 0.08); }
.tm-fp-icon { font-size: 20px; }
.tm-fp-name { flex: 1; font-size: 14px; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-fp-size { font-size: 11px; color: #64748b; }
.tm-fp-del {
  background: none; border: none; color: #64748b; cursor: pointer;
  width: 24px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.tm-fp-del:hover { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.tm-fp-upload {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 16px; padding: 12px;
  background: rgba(255, 255, 255, 0.05); border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 14px; color: #94a3b8; font-size: 13px; cursor: pointer;
  transition: all 0.2s;
}
.tm-fp-upload:hover { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.tm-fp-upload input[type=file] { display: none; }

/* ── Toast: назначение задачи ───────────────── */
.tm-toast-assigned {
  position: fixed; top: 24px; right: 24px; z-index: 10000;
  display: flex; align-items: flex-start; gap: 12px;
  max-width: 420px; padding: 16px 18px;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(99, 102, 241, 0.15);
  animation: tmToastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.tm-toast-icon { font-size: 24px; flex-shrink: 0; margin-top: 2px; }
.tm-toast-body { flex: 1; min-width: 0; }
.tm-toast-title {
  font-size: 13px; font-weight: 700; color: #a5b4fc;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;
}
.tm-toast-text { font-size: 14px; color: #e2e8f0; line-height: 1.45; }
.tm-toast-text strong { color: #fff; }
.tm-toast-close {
  background: none; border: none; color: #64748b; font-size: 20px;
  cursor: pointer; padding: 0 0 0 8px; line-height: 1; flex-shrink: 0;
}
.tm-toast-close:hover { color: #fff; }

@keyframes tmToastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes tmToastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(40px) scale(0.95); }
}

@media (max-width: 768px) {
  .tm-view { inset: 0 0 60px 0; }
  .tm-wrap { padding: 80px 16px 100px; }
  .tm-card { padding: 20px 16px; }
  .tm-add-form { gap: 6px; padding: 6px; }
  .tm-add-input { padding: 10px 6px; font-size: 14px; }
  .tm-add-btn { padding: 0 12px; height: 40px; font-size: 13px; }
  .tm-assign-btn { width: 40px; min-width: 40px; height: 40px; }
  .tm-toast-assigned { left: 12px; right: 12px; max-width: none; top: 16px; }
}

/* ── LIGHT THEME — TaskModule ── */
[data-mode="light"] .tm-view { color: #0f172a; }
[data-mode="light"] .tm-view::before { background: rgba(255, 255, 255, 0.35); }
[data-mode="light"] .tm-glow {
  background:
    radial-gradient(circle at 15% 15%, rgba(var(--primary-rgb), 0.06) 0%, transparent 35%),
    radial-gradient(circle at 85% 85%, rgba(var(--secondary-rgb), 0.04) 0%, transparent 35%);
}
[data-mode="light"] .tm-title {
  background: linear-gradient(to right, #0f172a, #475569) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}
[data-mode="light"] .tm-subtitle { color: #64748b !important; }
[data-mode="light"] .tm-card {
  background: rgba(255, 255, 255, 0.72) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06) !important;
}
[data-mode="light"] .tm-add-form {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}
[data-mode="light"] .tm-add-form:focus-within {
  background: rgba(0, 0, 0, 0.02) !important;
  border-color: rgba(var(--primary-rgb), 0.40) !important;
}
[data-mode="light"] .tm-add-input { color: #0f172a !important; }
[data-mode="light"] .tm-add-input::placeholder { color: #94a3b8 !important; }
[data-mode="light"] .tm-section-label { color: #64748b !important; }
[data-mode="light"] .tm-section-label::after { background: rgba(0, 0, 0, 0.06) !important; }
[data-mode="light"] .tm-task {
  background: rgba(0, 0, 0, 0.02) !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
}
[data-mode="light"] .tm-task:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.10) !important;
}
[data-mode="light"] .tm-checkbox {
  border-color: rgba(0, 0, 0, 0.15) !important;
  background: rgba(0, 0, 0, 0.02) !important;
}
[data-mode="light"] .tm-task-title { color: #0f172a !important; }
[data-mode="light"] .tm-task-meta { color: #64748b !important; }
[data-mode="light"] .tm-empty-text { color: #64748b !important; }
[data-mode="light"] .tm-delete-btn,
[data-mode="light"] .tm-file-btn,
[data-mode="light"] .tm-assign-task-btn {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #94a3b8 !important;
}
[data-mode="light"] .tm-assign-picker,
[data-mode="light"] .tm-assign-modal,
[data-mode="light"] .tm-file-popup {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(0, 0, 0, 0.10) !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.10) !important;
}
[data-mode="light"] .tm-assign-modal-overlay {
  background: rgba(0, 0, 0, 0.25) !important;
}
[data-mode="light"] .tm-assign-modal-title { color: #0f172a !important; }
[data-mode="light"] .tm-assign-modal-cancel {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.10) !important;
  color: #475569 !important;
}
[data-mode="light"] .tm-picker-item:hover { background: rgba(0, 0, 0, 0.04) !important; }
[data-mode="light"] .tm-picker-name { color: #0f172a !important; }
[data-mode="light"] .tm-fp-name { color: #0f172a !important; }
[data-mode="light"] .tm-fp-file:hover { background: rgba(0, 0, 0, 0.04) !important; }
[data-mode="light"] .tm-fp-upload {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #64748b !important;
}
[data-mode="light"] .tm-pending-badge {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #0f172a !important;
}
[data-mode="light"] .tm-assign-btn {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #64748b !important;
}