/* Tasks module — Intimate Constellation */

.tm-container {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 300px;
}

.tm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tm-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tm-tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tm-tab:hover,
.tm-tab.active {
  border-color: var(--lilu);
  color: var(--fg);
  background: rgba(185, 157, 255, 0.12);
}

.tm-btn {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tm-btn:hover {
  border-color: var(--lilu);
  background: rgba(185, 157, 255, 0.12);
}

.tm-btn.primary {
  background: linear-gradient(120deg, var(--lilu), var(--accent2));
  color: #150c33;
  border: 0;
  box-shadow: 0 8px 24px rgba(138, 107, 255, 0.35);
}

.tm-btn.primary:hover {
  transform: translateY(-1px);
}

.tm-btn.icon {
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 10px;
}

.tm-btn.icon.success {
  border-color: rgba(127, 220, 160, 0.5);
  color: var(--aur);
}

.tm-btn.icon.danger {
  border-color: rgba(255, 90, 90, 0.45);
  color: var(--err);
}

.tm-form-wrap {
  margin: 8px 0 14px;
}

.tm-form {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tm-form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tm-form-row.cols {
  flex-direction: row;
  gap: 12px;
}

.tm-form-row.cols > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tm-form label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  font-weight: 600;
}

.tm-form input,
.tm-form select {
  font-family: inherit;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  outline: none;
}

.tm-form input:focus,
.tm-form select:focus {
  border-color: var(--lilu);
  box-shadow: 0 0 0 2px rgba(185, 157, 255, 0.2);
}

.tm-form-actions {
  display: flex;
  gap: 10px;
}

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

.tm-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
}

.tm-item:hover {
  border-color: rgba(185, 157, 255, 0.45);
  background: rgba(185, 157, 255, 0.06);
}

.tm-item.done {
  opacity: 0.55;
}

.tm-item.active {
  border-left: 3px solid var(--lilu);
}

.tm-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
}

.tm-status {
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.tm-item.active .tm-status {
  color: var(--lilu);
}

.tm-item.done .tm-status {
  color: var(--aur);
}

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

.tm-text {
  font-size: 15px;
  line-height: 1.5;
  word-break: break-word;
}

.tm-context {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.tm-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.tm-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.tm-empty,
.tm-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  gap: 12px;
  color: var(--muted);
  text-align: center;
}

.tm-empty-icon,
.tm-state-icon {
  font-size: 48px;
  opacity: 0.35;
}

.tm-empty-text,
.tm-state-text {
  font-size: 14px;
  max-width: 320px;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .tm-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .tm-tabs {
    width: 100%;
  }

  .tm-tab {
    flex: 1;
    text-align: center;
  }

  .tm-form-row.cols {
    flex-direction: column;
  }

  .tm-item {
    flex-direction: column;
  }

  .tm-actions {
    align-self: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tm-tab,
  .tm-btn,
  .tm-item,
  .tm-form input,
  .tm-form select {
    transition: none;
  }
}
